Skip to content

Commit

Permalink
1.3.1 packed files
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Jan 7, 2016
1 parent 43fa5db commit 7883d4e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion production/jquery.fenster.css

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

2 changes: 1 addition & 1 deletion production/jquery.fenster.full.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* jqFenster - Lightweight Modal Framework
* Version: 1.3.0 (2016-01-06)
* Version: 1.3.1 (2016-01-07)
* https://github.com/kkamkou/jqFenster
*/

Expand Down
25 changes: 19 additions & 6 deletions production/jquery.fenster.full.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* jqFenster - Lightweight Modal Framework
* Version: 1.3.0 (2016-01-06)
* Version: 1.3.1 (2016-01-07)
* https://github.com/kkamkou/jqFenster
*/
(function($) {
Expand Down Expand Up @@ -174,20 +174,33 @@

// jQuery plugin
$.fn.fenster = function (options) {
// prevents incorrect selectors
if (!this.length) {
return $.error('Element "%s" isn\'t found'.replace('%s', this.selector));
}

// prevents incorrect elements
if (!this.hasClass('jqFenster')) {
return $.fenster(this.selector);
}
return new JqFensterApi(this, options);

if (!this.data('jqFensterDestroyable')) {
return new JqFensterApi(this, options);
}

// singleton pattern (bad idea, but speed-up the framework)
var elem = this.get(0);
if (!$.data(elem, 'JqFensterApi')) {
$.data(elem, 'JqFensterApi', new JqFensterApi(this, options))
}
return $.data(elem, 'JqFensterApi');
};

// helps to find/create the jqFenster object
$.extend({
// $.fensterFinder(selector|this)
fensterFinder: function (target) {
var $elem, $target;

// target is a selector or an api instance
$target = (target instanceof JqFensterApi) ? target.element : $(target);
var $elem, $target = $(target);

// target is link already
if ($target.data('jqFensterHolder')) {
Expand Down
Loading

0 comments on commit 7883d4e

Please sign in to comment.