Added support for direct chat contacts toggle button

pull/276/head
Abdullah Almsaeed 2015-02-27 19:58:00 -05:00
parent 26fc4f6a53
commit 7b5711f4e4
4 changed files with 22 additions and 11 deletions

20
dist/js/app.js vendored
View File

@ -11,13 +11,13 @@
* @license MIT <http://opensource.org/licenses/MIT> * @license MIT <http://opensource.org/licenses/MIT>
*/ */
'use strict';
//Make sure jQuery has been loaded before app.js //Make sure jQuery has been loaded before app.js
if (typeof jQuery === "undefined") { if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery"); throw new Error("AdminLTE requires jQuery");
} }
'use strict';
/* AdminLTE /* AdminLTE
* *
* @type Object * @type Object
@ -77,6 +77,13 @@ $.AdminLTE.options = {
collapse: '[data-widget="collapse"]' collapse: '[data-widget="collapse"]'
} }
}, },
//Direct Chat plugin options
directChat: {
//Enable direct chat by default
enable: true,
//The button to open and close the chat contacts pane
contactToggleSelector: '[data-widget="chat-pane-toggle"]'
},
//Define the set of colors to use globally around the website //Define the set of colors to use globally around the website
colors: { colors: {
lightBlue: "#3c8dbc", lightBlue: "#3c8dbc",
@ -139,10 +146,19 @@ $(function () {
$.AdminLTE.boxWidget.activate(); $.AdminLTE.boxWidget.activate();
} }
//Activate fast click
if (o.enableFastclick && typeof FastClick != 'undefined') { if (o.enableFastclick && typeof FastClick != 'undefined') {
FastClick.attach(document.body); FastClick.attach(document.body);
} }
//Activate direct chat widget
if (o.directChat.enable) {
$(o.directChat.contactToggleSelector).click(function () {
var box = $(this).parents('.direct-chat').first();
box.toggleClass('direct-chat-contacts-open');
});
}
/* /*
* INITIALIZE BUTTON TOGGLE * INITIALIZE BUTTON TOGGLE
* ------------------------ * ------------------------

2
dist/js/app.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,6 @@
'use strict'; 'use strict';
$(function () { $(function () {
//Simple implementation of direct chat contact pane toggle (TEMPORARY)
$('[data-widget="chat-pane-toggle"]').click(function(){
$("#myDirectChat").toggleClass('direct-chat-contacts-open');
});
/* ChartJS /* ChartJS
* ------- * -------
* Here we will create a few charts using ChartJS * Here we will create a few charts using ChartJS

View File

@ -705,7 +705,7 @@
<div class='row'> <div class='row'>
<div class='col-md-4'> <div class='col-md-4'>
<!-- DIRECT CHAT --> <!-- DIRECT CHAT -->
<div id="myDirectChat" class="box box-warning direct-chat direct-chat-warning"> <div class="box box-warning direct-chat direct-chat-warning">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Direct Chat</h3> <h3 class="box-title">Direct Chat</h3>
<div class="box-tools pull-right"> <div class="box-tools pull-right">