Skip to content

Commit

Permalink
Dist v 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bcinarli committed Nov 27, 2015
1 parent 27d539a commit cd66fdb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 65 deletions.
7 changes: 5 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxrocket.modal",
"version": "1.3.3",
"version": "1.4.0",
"homepage": "https://github.com/uxrocket/uxrocket.modal",
"authors": [
"Bilal Çınarlı <[email protected]>"
Expand All @@ -10,10 +10,13 @@
"dependencies": {
"jquery": ">=1.11.1"
},
"devDependencies": {
"uxrocket.factory": "1.0.0-alpha2"
},
"keywords": [
"jQuery",
"javascript",
"modal",
"modal",
"uxrocket"
],
"license": "MIT",
Expand Down
81 changes: 24 additions & 57 deletions dist/uxrocket.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
instance = 1,

overlay = '<div id="uxr-modal-overlay"></div>',
content = '<div id="{{id}}" class="uxr-modal-container uxr-modal-loading">' +
' <div class="uxr-modal-drag uxr-modal-hide"></div>' +
' <div class="uxr-modal-content">' +
' <div class="uxr-modal-loaded-content"></div>' +
content = '<div id="{{id}}" class="{{container}} {{loading}}">' +
' <div class="{{drag}} {{hide}}"></div>' +
' <div class="{{content}}">' +
' <div class="{{loadedContent}}"></div>' +
' </div>' +
' <a href="#" class="uxr-modal-close uxr-modal-hide"></a>' +
' <a href="#" class="{{close}} {{hide}}"></a>' +
'</div>',
openedInstances = {},

Expand Down Expand Up @@ -89,7 +89,9 @@
close: 'close',
hide: 'hide'
}
};
},

utils = new uxrPluginUtils({ns: ns});

var Modal = function(el, options, selector) {
this._name = rocketName;
Expand Down Expand Up @@ -200,7 +202,17 @@
Modal.prototype.prepare = function() {
var css = {},
$overlay = $('#uxr-modal-overlay'),
_content = content.replace('{{id}}', 'uxr-modal-instance-' + this._instance),
data = {
id: 'uxr-modal-instance-' + this._instance,
container: utils.getClassname('container'),
loading: utils.getClassname('loading'),
drag: utils.getClassname('drag'),
hide: utils.getClassname('hide'),
content: utils.getClassname('content'),
loadedContent: utils.getClassname('loadedContent'),
close: utils.getClassname('close')
},
_content = utils.render(content, data),
_appendTo = 'body';

this.emitEvent('start');
Expand Down Expand Up @@ -336,6 +348,10 @@

modal.close(this);

if(this._direct) {
this.removeContent();
}

this.emitEvent('close');
};

Expand Down Expand Up @@ -542,55 +558,6 @@
}
};

var utils = {
callback: function(fn) {
// if callback string is function call it directly
if(typeof fn === 'function') {
fn.apply(this);
}

// if callback defined via data-attribute, call it via new Function
else {
if(fn !== false) {
var func = new Function('return ' + fn);
func();
}
}
},

escapeSelector: function(selector) {
var is_ID = selector.charAt(0) === '#',
re = /([ !"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g;

return is_ID ? '#' + selector.substring(1).replace(re, '\\$1') : selector;
},

getStringVariable: function(str) {
var val;
// check if it is chained
if(str.indexOf('.') > -1) {
var chain = str.split('.'),
chainVal = window[chain[0]];

for(var i = 1; i < chain.length; i++) {
chainVal = chainVal[chain[i]];
}

val = chainVal;
}

else {
val = window[str];
}

return val;
},

getClassname: function(which) {
return ns.prefix + ns.name + '-' + ns.classes[which];
}
};

ux = $.fn.modal = $.fn.uxrmodal = $.uxrmodal = function(options) {
var selector = this.selector;

Expand Down Expand Up @@ -639,7 +606,7 @@
return openedInstances;
};

ux.version = '1.3.3';
ux.version = '1.4.0';

ux.settings = defaults;
}));
4 changes: 2 additions & 2 deletions dist/uxrocket.modal.min.css

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

Loading

0 comments on commit cd66fdb

Please sign in to comment.