Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Mar 5, 2014
1 parent f135241 commit 712f2cf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.remodal.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Remodal - v0.1.1 - 2014-02-23
/*! Remodal - v0.1.2 - 2014-03-05
* https://github.com/VodkaBears/remodal
* Copyright (c) 2014 VodkaBears; */

Expand Down
35 changes: 24 additions & 11 deletions dist/jquery.remodal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Remodal - v0.1.1 - 2014-02-23
/*! Remodal - v0.1.2 - 2014-03-05
* https://github.com/VodkaBears/remodal
* Copyright (c) 2014 VodkaBears; */
;(function ($) {
Expand All @@ -13,10 +13,12 @@
};

/**
* Instances of modal windows.
* @type {Array}
* Special plugin object for instances.
* @type {Object}
*/
var instances = [];
$[pluginName] = {
lookup: []
};

/**
* Current modal
Expand Down Expand Up @@ -44,6 +46,10 @@
return (parseFloat(duration) + parseFloat(delay)) * 1000;
};

/**
* Get a scrollbar width
* @return {Number}
*/
var getScrollbarWidth = function () {
var outer = document.createElement("div");
outer.style.visibility = "hidden";
Expand Down Expand Up @@ -91,7 +97,7 @@
this.modal = modal;
this.buildDOM();
this.addEventListeners();
this.index = instances.push(this) - 1;
this.index = $[pluginName].lookup.push(this) - 1;
this.busy = false;
}

Expand Down Expand Up @@ -213,7 +219,6 @@
}

this.body.removeClass(pluginName + "_active");
console.log(this.td);

setTimeout(function () {
this.overlay.hide();
Expand All @@ -226,13 +231,21 @@

if ($) {
$["fn"][pluginName] = function (opts) {
return this["each"](function (i, e) {
var instance;
this["each"](function (i, e) {
var $e = $(e);
if (!$e.data(pluginName)) {
var instance = new Remodal($e, opts);
instance = new Remodal($e, opts);
$e.data(pluginName, instance.index);

if (instance.settings.hashTracking &&
$e.attr("data-" + pluginName + "-id") === location.hash.substr(1)) {
instance.open();
}
}
});

return instance;
};
}

Expand All @@ -246,7 +259,7 @@
id = elem.getAttribute("data-" + pluginName + "-target"),
$target = $("[data-" + pluginName + "-id=" + id + "]");

instances[$target.data(pluginName)].open();
$[pluginName].lookup[$target.data(pluginName)].open();
});

/**
Expand Down Expand Up @@ -287,7 +300,8 @@
var $elem = $("[data-" + pluginName + "-id=" + id + "]");

if ($elem.length) {
var instance = instances[$elem.data(pluginName)];
var instance = $[pluginName].lookup[$elem.data(pluginName)];

if (instance && instance.settings.hashTracking) {
instance.open();
}
Expand All @@ -296,5 +310,4 @@
}
};
$(window).bind("hashchange." + pluginName, hashHandler);
hashHandler(null, false);
})(window["jQuery"] || window["Zepto"]);
4 changes: 2 additions & 2 deletions dist/jquery.remodal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 712f2cf

Please sign in to comment.