t||(this.opts.caretUp=!0,this.$caret.addClass("up"))},getCaret:function(){return this.$element.find(".caret")},toggleCaretOpen:function(){this.opts.caretUp?this.$caret.removeClass("up").addClass("down"):this.$caret.removeClass("down").addClass("up")},toggleCaretClose:function(){this.opts.caretUp?this.$caret.removeClass("down").addClass("up"):this.$caret.removeClass("up").addClass("down")},toggle:function(t){this.isOpened()?this.close(t):this.open(t)},open:function(t){t&&t.preventDefault(),this.callback("open"),e(".dropdown").removeClass("open").addClass("hide"),this.opts.height&&this.$target.css("min-height",this.opts.height+"px"),this.opts.width&&this.$target.width(this.opts.width),this.setPosition(),this.toggleCaretOpen(),this.$target.animation(this.opts.animationOpen,e.proxy(this.onOpened,this))},close:function(t){if(this.isOpened()){if(t){if(this.shouldNotBeClosed(t.target))return;t.preventDefault()}this.utils.enableBodyScroll(),this.callback("close"),this.toggleCaretClose(),this.$target.animation(this.opts.animationClose,e.proxy(this.onClosed,this))}},onClosed:function(){this.$target.removeClass("open"),this.disableEvents(),this.callback("closed")},onOpened:function(){this.$target.addClass("open"),this.enableEvents(),this.callback("opened")},isOpened:function(){return this.$target.hasClass("open")},enableEvents:function(){this.detect.isDesktop()&&this.$target.on("mouseover."+this.namespace,e.proxy(this.utils.disableBodyScroll,this.utils)).on("mouseout."+this.namespace,e.proxy(this.utils.enableBodyScroll,this.utils)),e(document).on("scroll."+this.namespace,e.proxy(this.setPosition,this)),e(window).on("resize."+this.namespace,e.proxy(this.setPosition,this)),e(document).on("click."+this.namespace+" touchstart."+this.namespace,e.proxy(this.close,this)),e(document).on("keydown."+this.namespace,e.proxy(this.handleKeyboard,this)),this.$target.find('[data-action="dropdown-close"]').on("click."+this.namespace,e.proxy(this.close,this))},disableEvents:function(){this.$target.off("."+this.namespace),e(document).off("."+this.namespace),e(window).off("."+this.namespace)},handleKeyboard:function(t){27===t.which&&this.close(t)},shouldNotBeClosed:function(t){return"dropdown-close"!==e(t).attr("data-action")&&t!==this.$close[0]&&0!==e(t).closest(".dropdown").length},isNavigationFixed:function(){return 0!==this.$element.closest(".fixed").length},getPlacement:function(t){return e(document).height()"),t.each(e.proxy(this.buildLiveItem,this)),this.$element.html("").append(this.$liveTabsList))},buildLiveItem:function(t,s){var i=e(s),n=e(""),o=e(""),a=t+1;i.attr("id",this.getLiveItemId(i,a));var h="#"+i.attr("id"),l=this.getLiveItemTitle(i);o.attr("href",h).attr("rel",h).text(l),n.append(o),this.$liveTabsList.append(n)},getLiveItemId:function(t,e){return void 0===t.attr("id")?this.opts.live.replace(".","")+e:t.attr("id")},getLiveItemTitle:function(t){return void 0===t.attr("data-title")?t.attr("id"):t.attr("data-title")},setActiveItem:function(){this.currentHash?(this.currentItem=this.getItemBy(this.currentHash),this.opts.active=this.currentHash):!1===this.opts.active&&(this.currentItem=this.getItem(this.$items.first()),this.opts.active=this.currentItem.hash),this.addActive(this.currentItem)},addActive:function(t){t.$parent.addClass("active"),t.$tab.removeClass("hide").addClass("open"),this.currentItem=t},removeActive:function(t){t.$parent.removeClass("active"),t.$tab.addClass("hide").removeClass("open"),this.currentItem=!1},next:function(t){t&&t.preventDefault();var e=this.getItem(this.fetchElement("next"));this.open(e.hash),this.callback("next",e)},prev:function(t){t&&t.preventDefault();var e=this.getItem(this.fetchElement("prev"));this.open(e.hash),this.callback("prev",e)},fetchElement:function(t){var e;if(!1!==this.currentItem){if(0===(e=this.currentItem.$parent[t]().find("a")).length)return}else e=this.$items[0];return e},open:function(t,e){if(void 0!==t){"object"==typeof t&&t.preventDefault();var s="object"==typeof t?this.getItem(t.target):this.getItemBy(t);this.closeAll(),this.callback("open",s),this.addActive(s),this.pushStateOpen(e,s),this.callback("opened",s)}},pushStateOpen:function(t,e){!1!==t&&!1!==this.opts.hash&&history.pushState(!1,!1,e.hash)},close:function(t){var e=this.getItemBy(t);e.$parent.hasClass("active")&&(this.callback("close",e),this.removeActive(e),this.pushStateClose(),this.callback("closed",e))},pushStateClose:function(){!1!==this.opts.hash&&history.pushState(!1,!1," ")},closeAll:function(){this.$tabs.removeClass("open").addClass("hide"),this.$items.parent().removeClass("active")},getItem:function(t){var s={};return s.$el=e(t),s.hash=s.$el.attr("href"),s.$parent=s.$el.parent(),s.$tab=e(s.hash),s},getItemBy:function(t){var e="number"==typeof t?this.$items.eq(t-1):this.$element.find('[rel="'+t+'"]');return this.getItem(e)},getLocationHash:function(){return!1!==this.opts.hash&&(!!this.isHash()&&top.location.hash)},isHash:function(){return!(""===top.location.hash||-1===e.inArray(top.location.hash,this.hashesCollection))},setItemHeight:function(){if(this.opts.equals){var t=this.getItemMaxHeight()+"px";this.$tabs.css("min-height",t)}},getItemMaxHeight:function(){var t=0;return this.$tabs.each(function(){var s=e(this).height();t=s>t?s:t}),t}},t.Tabs.inherits(t),t.Plugin.create("Tabs"),t.Plugin.autoload("Tabs")}(Kube,jQuery),function(t){t.modalcurrent=null,t.modalwindow=function(e){var s=t.extend({},e,{show:!0});t("").modal(s)}}(jQuery),function(t,e){t.Modal=function(e,s){this.namespace="modal",this.defaults={target:null,show:!1,url:!1,header:!1,width:"600px",height:!1,maxHeight:!1,position:"center",overlay:!0,appendForms:!1,appendFields:!1,animationOpen:"show",animationClose:"hide",callbacks:["open","opened","close","closed"]},t.apply(this,arguments),this.utils=new t.Utils,this.detect=new t.Detect,this.start()},t.Modal.prototype={start:function(){this.hasTarget()&&(this.opts.show?this.load():this.$element.on("click."+this.namespace,e.proxy(this.load,this)))},buildModal:function(){this.$modal=this.$target.find(".modal"),this.$header=this.$target.find(".modal-header"),this.$close=this.$target.find(".close"),this.$body=this.$target.find(".modal-body")},buildOverlay:function(){!1!==this.opts.overlay&&(0!==e("#modal-overlay").length?this.$overlay=e("#modal-overlay"):(this.$overlay=e('').addClass("hide"),e("body").prepend(this.$overlay)),this.$overlay.addClass("overlay"))},buildHeader:function(){this.opts.header&&this.$header.html(this.opts.header)},load:function(t){this.buildModal(),this.buildOverlay(),this.buildHeader(),this.opts.url?this.buildContent():this.open(t)},open:function(t){t&&t.preventDefault(),this.isOpened()||(this.detect.isMobile()&&(this.opts.width="96%"),this.opts.overlay&&this.$overlay.removeClass("hide"),this.$target.removeClass("hide"),this.$modal.removeClass("hide"),this.enableEvents(),this.findActions(),this.resize(),e(window).on("resize."+this.namespace,e.proxy(this.resize,this)),this.detect.isDesktop()&&this.utils.disableBodyScroll(),this.$modal.find("input[type=text],input[type=url],input[type=email]").on("keydown."+this.namespace,e.proxy(this.handleEnter,this)),this.callback("open"),this.$modal.animation(this.opts.animationOpen,e.proxy(this.onOpened,this)))},close:function(t){if(this.$modal&&this.isOpened()){if(t){if(this.shouldNotBeClosed(t.target))return;t.preventDefault()}this.callback("close"),this.disableEvents(),this.$modal.animation(this.opts.animationClose,e.proxy(this.onClosed,this)),this.opts.overlay&&this.$overlay.animation(this.opts.animationClose)}},onOpened:function(){this.$modal.addClass("open"),this.callback("opened"),e.modalcurrent=this},onClosed:function(){this.callback("closed"),this.$target.addClass("hide"),this.$modal.removeClass("open"),this.detect.isDesktop()&&this.utils.enableBodyScroll(),this.$body.css("height",""),e.modalcurrent=null},isOpened:function(){return this.$modal.hasClass("open")},getData:function(){var e=new t.FormData(this);return e.set(""),e.get()},buildContent:function(){e.ajax({url:this.opts.url+"?"+(new Date).getTime(),cache:!1,type:"post",data:this.getData(),success:e.proxy(function(t){this.$body.html(t),this.open()},this)})},buildWidth:function(){var t=this.opts.width,s="2%",i="2%",n=t.match(/%$/);parseInt(this.opts.width)>e(window).width()&&!n?t="96%":n||(s="16px",i="16px"),this.$modal.css({width:t,"margin-top":s,"margin-bottom":i})},buildPosition:function(){if("center"===this.opts.position){var t=e(window).height(),s=this.$modal.outerHeight(),i=t/2-s/2+"px";this.detect.isMobile()?i="2%":s>t&&(i="16px"),this.$modal.css("margin-top",i)}},buildHeight:function(){var t=e(window).height();if(this.opts.maxHeight){var s=parseInt(this.$body.css("padding-top"))+parseInt(this.$body.css("padding-bottom")),i=parseInt(this.$modal.css("margin-top"))+parseInt(this.$modal.css("margin-bottom")),n=t-this.$header.innerHeight()-s-i;this.$body.height(n)}else!1!==this.opts.height&&this.$body.css("height",this.opts.height);this.$modal.outerHeight()>t&&(this.opts.animationOpen="show",this.opts.animationClose="hide")},resize:function(){this.buildWidth(),this.buildPosition(),this.buildHeight()},enableEvents:function(){this.$close.on("click."+this.namespace,e.proxy(this.close,this)),e(document).on("keyup."+this.namespace,e.proxy(this.handleEscape,this)),this.$target.on("click."+this.namespace,e.proxy(this.close,this))},disableEvents:function(){this.$close.off("."+this.namespace),e(document).off("."+this.namespace),this.$target.off("."+this.namespace),e(window).off("."+this.namespace)},findActions:function(){this.$body.find('[data-action="modal-close"]').on("mousedown."+this.namespace,e.proxy(this.close,this))},setHeader:function(t){this.$header.html(t)},setContent:function(t){this.$body.html(t)},setWidth:function(t){this.opts.width=t,this.resize()},getModal:function(){return this.$modal},getBody:function(){return this.$body},getHeader:function(){return this.$header},handleEnter:function(t){13===t.which&&(t.preventDefault(),this.close(!1))},handleEscape:function(t){return 27!==t.which||this.close(!1)},shouldNotBeClosed:function(t){return"modal-close"!==e(t).attr("data-action")&&t!==this.$close[0]&&0!==e(t).closest(".modal").length}},t.Modal.inherits(t),t.Plugin.create("Modal"),t.Plugin.autoload("Modal")}(Kube,jQuery);
\ No newline at end of file
diff --git a/src/_js/Collapse/Kube.Collapse.js b/src/_js/Collapse/Kube.Collapse.js
index 5e5d87d..3d2c8b4 100644
--- a/src/_js/Collapse/Kube.Collapse.js
+++ b/src/_js/Collapse/Kube.Collapse.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Collapse = function(element, options)
{
@@ -201,4 +201,4 @@
Kube.Plugin.create('Collapse');
Kube.Plugin.autoload('Collapse');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
diff --git a/src/_js/Core/Kube.Animation.js b/src/_js/Core/Kube.Animation.js
index 1328d15..8718746 100644
--- a/src/_js/Core/Kube.Animation.js
+++ b/src/_js/Core/Kube.Animation.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Animation = function(element, effect, callback)
{
@@ -130,7 +130,7 @@
// Inheritance
Kube.Animation.inherits(Kube);
-}(Kube));
+}(Kube,jQuery));
// Plugin
(function($)
@@ -150,4 +150,4 @@
$.fn.animation.options = {};
-})(jQuery);
\ No newline at end of file
+})(jQuery);
diff --git a/src/_js/Core/Kube.Formdata.js b/src/_js/Core/Kube.Formdata.js
index f8cb027..40d1956 100644
--- a/src/_js/Core/Kube.Formdata.js
+++ b/src/_js/Core/Kube.Formdata.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.FormData = function(app)
{
@@ -79,4 +79,4 @@
};
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Core/Kube.Plugin.js b/src/_js/Core/Kube.Plugin.js
index 4fd7f52..5e36e43 100644
--- a/src/_js/Core/Kube.Plugin.js
+++ b/src/_js/Core/Kube.Plugin.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Plugin = {
create: function(classname, pluginname)
@@ -125,4 +125,4 @@
Kube.Plugin.watch();
});
-}(Kube));
\ No newline at end of file
+}(Kube, jQuery));
diff --git a/src/_js/Core/Kube.Response.js b/src/_js/Core/Kube.Response.js
index 581d324..ec43566 100644
--- a/src/_js/Core/Kube.Response.js
+++ b/src/_js/Core/Kube.Response.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Response = function(app) {};
@@ -105,4 +105,4 @@
};
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Core/Kube.Utils.js b/src/_js/Core/Kube.Utils.js
index 4c4786d..8b94cae 100644
--- a/src/_js/Core/Kube.Utils.js
+++ b/src/_js/Core/Kube.Utils.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Utils = function() {};
@@ -43,4 +43,4 @@
};
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Core/Kube.js b/src/_js/Core/Kube.js
index 8916673..889b430 100644
--- a/src/_js/Core/Kube.js
+++ b/src/_js/Core/Kube.js
@@ -11,7 +11,7 @@
if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
;(function($) { var version = $.fn.jquery.split('.'); if (version[0] == 1 && version[1] < 8) {throw new Error('Kube\'s requires at least jQuery v1.8'); }})(jQuery);
-;(function()
+;(function($)
{
// Inherits
Function.prototype.inherits = function(parent)
@@ -91,4 +91,4 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
// Scope
window.Kube = Kube;
-})();
\ No newline at end of file
+})(jQuery);
\ No newline at end of file
diff --git a/src/_js/Dropdown/Kube.Dropdown.js b/src/_js/Dropdown/Kube.Dropdown.js
index ac82b2a..9642b4d 100644
--- a/src/_js/Dropdown/Kube.Dropdown.js
+++ b/src/_js/Dropdown/Kube.Dropdown.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Dropdown = function(element, options)
{
@@ -246,4 +246,4 @@
Kube.Plugin.create('Dropdown');
Kube.Plugin.autoload('Dropdown');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Message/Kube.Message.js b/src/_js/Message/Kube.Message.js
index e62340f..b777fa6 100644
--- a/src/_js/Message/Kube.Message.js
+++ b/src/_js/Message/Kube.Message.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Message = function(element, options)
{
@@ -79,4 +79,4 @@
Kube.Plugin.create('Message');
Kube.Plugin.autoload('Message');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Modal/Kube.Modal.js b/src/_js/Modal/Kube.Modal.js
index f92ad4b..d4c2db3 100644
--- a/src/_js/Modal/Kube.Modal.js
+++ b/src/_js/Modal/Kube.Modal.js
@@ -16,7 +16,7 @@
})(jQuery);
-(function(Kube)
+(function(Kube,$)
{
Kube.Modal = function(element, options)
{
@@ -340,4 +340,4 @@
Kube.Plugin.create('Modal');
Kube.Plugin.autoload('Modal');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Offcanvas/Kube.Offcanvas.js b/src/_js/Offcanvas/Kube.Offcanvas.js
index 25c63f7..8843135 100644
--- a/src/_js/Offcanvas/Kube.Offcanvas.js
+++ b/src/_js/Offcanvas/Kube.Offcanvas.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Offcanvas = function(element, options)
{
@@ -189,4 +189,4 @@
Kube.Plugin.create('Offcanvas');
Kube.Plugin.autoload('Offcanvas');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Sticky/Kube.Sticky.js b/src/_js/Sticky/Kube.Sticky.js
index c8b7333..38c4593 100644
--- a/src/_js/Sticky/Kube.Sticky.js
+++ b/src/_js/Sticky/Kube.Sticky.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Sticky = function(element, options)
{
@@ -61,4 +61,4 @@
Kube.Plugin.create('Sticky');
Kube.Plugin.autoload('Sticky');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Tabs/Kube.Tabs.js b/src/_js/Tabs/Kube.Tabs.js
index e9bf858..4ad6247 100644
--- a/src/_js/Tabs/Kube.Tabs.js
+++ b/src/_js/Tabs/Kube.Tabs.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Tabs = function(element, options)
{
@@ -308,4 +308,4 @@
Kube.Plugin.create('Tabs');
Kube.Plugin.autoload('Tabs');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file
diff --git a/src/_js/Toggleme/Kube.Toggleme.js b/src/_js/Toggleme/Kube.Toggleme.js
index ca78666..47d15df 100644
--- a/src/_js/Toggleme/Kube.Toggleme.js
+++ b/src/_js/Toggleme/Kube.Toggleme.js
@@ -3,7 +3,7 @@
* @author Imperavi LLC
* @license MIT
*/
-(function(Kube)
+(function(Kube,$)
{
Kube.Toggleme = function(element, options)
{
@@ -108,4 +108,4 @@
Kube.Plugin.create('Toggleme');
Kube.Plugin.autoload('Toggleme');
-}(Kube));
\ No newline at end of file
+}(Kube,jQuery));
\ No newline at end of file