Ver código fonte

Added support for direct chat contacts toggle button

Abdullah Almsaeed 10 anos atrás
pai
commit
7b5711f4e4
4 arquivos alterados com 21 adições e 10 exclusões
  1. 20 4
      dist/js/app.js
  2. 0 0
      dist/js/app.min.js
  3. 0 5
      dist/js/pages/dashboard2.js
  4. 1 1
      index2.html

+ 20 - 4
dist/js/app.js

@@ -11,13 +11,13 @@
  * @license MIT <http://opensource.org/licenses/MIT>
  */
 
+'use strict';
+
 //Make sure jQuery has been loaded before app.js
 if (typeof jQuery === "undefined") {
   throw new Error("AdminLTE requires jQuery");
 }
 
-'use strict';
-
 /* AdminLTE
  *
  * @type Object
@@ -77,6 +77,13 @@ $.AdminLTE.options = {
       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
   colors: {
     lightBlue: "#3c8dbc",
@@ -138,11 +145,20 @@ $(function () {
   if (o.enableBoxWidget) {
     $.AdminLTE.boxWidget.activate();
   }
-  
-  if(o.enableFastclick && typeof FastClick != 'undefined') {
+
+  //Activate fast click
+  if (o.enableFastclick && typeof FastClick != 'undefined') {
     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
    * ------------------------

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
dist/js/app.min.js


+ 0 - 5
dist/js/pages/dashboard2.js

@@ -1,10 +1,5 @@
 'use strict';
 $(function () {
-  
-  //Simple implementation of direct chat contact pane toggle (TEMPORARY)
-  $('[data-widget="chat-pane-toggle"]').click(function(){
-    $("#myDirectChat").toggleClass('direct-chat-contacts-open');
-  });
 
   /* ChartJS
    * -------

+ 1 - 1
index2.html

@@ -705,7 +705,7 @@
           <div class='row'>
             <div class='col-md-4'>
               <!-- 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">
                   <h3 class="box-title">Direct Chat</h3>
                   <div class="box-tools pull-right">

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff