1/*! 2 * remark (http://getbootstrapadmin.com/remark) 3 * Copyright 2015 amazingsurge 4 * Licensed under the Themeforest Standard Licenses 5 */ 6(function(window, document, $) { 7 'use strict'; 8 9 $.site.sidebar = { 10 init: function() { 11 if (typeof $.slidePanel === 'undefined') return; 12 13 $(document).on('click', '[data-toggle="site-sidebar"]', function() { 14 var $this = $(this); 15 16 var direction = 'right'; 17 if ($('body').hasClass('site-menubar-flipped')) { 18 direction = 'left'; 19 } 20 21 var defaults = $.components.getDefaults("slidePanel"); 22 var options = $.extend({}, defaults, { 23 direction: direction, 24 skin: 'site-sidebar', 25 dragTolerance: 80, 26 template: function(options) { 27 return '<div class="' + options.classes.base + ' ' + options.classes.base + '-' + options.direction + '">' + 28 '<div class="' + options.classes.content + ' site-sidebar-content"></div>' + 29 '<div class="slidePanel-handler"></div>' + 30 '</div>'; 31 }, 32 afterLoad: function() { 33 var self = this; 34 this.$panel.find('.tab-pane').asScrollable({ 35 namespace: 'scrollable', 36 contentSelector: "> div", 37 containerSelector: "> div" 38 }); 39 40 $.components.init('switchery', self.$panel); 41 42 this.$panel.on('shown.bs.tab', function() { 43 self.$panel.find(".tab-pane.active").asScrollable('update'); 44 }); 45 }, 46 beforeShow: function() { 47 if (!$this.hasClass('active')) { 48 $this.addClass('active'); 49 } 50 }, 51 afterHide: function() { 52 if ($this.hasClass('active')) { 53 $this.removeClass('active'); 54 } 55 } 56 }); 57 58 if ($this.hasClass('active')) { 59 $.slidePanel.hide(); 60 } else { 61 var url = $this.data('url'); 62 if (!url) { 63 url = $this.attr('href'); 64 url = url && url.replace(/.*(?=#[^\s]*$)/, ''); 65 } 66 67 $.slidePanel.show({ 68 url: url 69 }, options); 70 } 71 }); 72 73 $(document).on('click', '[data-toggle="show-chat"]', function() { 74 $('#conversation').addClass('active'); 75 }); 76 77 78 $(document).on('click', '[data-toggle="close-chat"]', function() { 79 $('#conversation').removeClass('active'); 80 }); 81 } 82 }; 83 84})(window, document, jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.