From e933ff3244e5e277959794ddcd38cb8fe338fed7 Mon Sep 17 00:00:00 2001 From: Insolita Date: Tue, 18 Nov 2014 04:44:06 +0800 Subject: [PATCH 1/3] Update jquery.the-modal.js Fix bootstrap modal conflict --- jquery.the-modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.the-modal.js b/jquery.the-modal.js index 6afbc4e..fbefa0b 100644 --- a/jquery.the-modal.js +++ b/jquery.the-modal.js @@ -245,11 +245,11 @@ }; } - $.modal = function(options){ + $.themodal = function(options){ return init($(), options); }; - $.fn.modal = function(options) { + $.fn.themodal = function(options) { return init(this, options); }; From 6a1153a80a9847e4ac8c21a546c8eb9de837db8f Mon Sep 17 00:00:00 2001 From: Insolita Date: Tue, 18 Nov 2014 04:45:54 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 49f8f07..e586a05 100644 --- a/README.md +++ b/README.md @@ -57,21 +57,21 @@ $('.modal .close').on('click', function(e){ // open modal with default options or options set with init // content will be taken from #login -$('#terms-of-service').modal().open(); +$('#terms-of-service').themodal().open(); // also we can open modal overriding some default options -$('#terms-of-service').modal().open({ +$('#terms-of-service').themodal().open({ closeOnESC: false }); // Close modal. There's no need to choose which one since only one can be opened -$.modal().close(); +$.themodal().close(); ``` ### Custom content ```javascript -$.modal().open({ +$.themodal().open({ onOpen: function(el, options){ el.html('Hello!'); } @@ -81,7 +81,7 @@ $.modal().open({ ### AJAX-content ```javascript -$.modal().open({ +$.themodal().open({ onOpen: function(el, options){ $.get('http://example.com/', function(data){ el.html(data); @@ -93,7 +93,7 @@ $.modal().open({ ### Available options (default values) ```javascript -$.modal({ +$.themodal({ /* css class of locked container(body) */ lockClass: 'themodal-lock', @@ -125,12 +125,12 @@ $.modal({ ```javascript // set option as default for all modals opened -$.modal({ +$.themodal({ closeOnESC: true }); // set some default options for specific dom element -$('#login').modal({ +$('#login').themodal({ closeOnESC: true, onClose: function(el, options) { alert('Closed!'); From 70ff8e3322723c4b5fbebe728f06aa5561f96be5 Mon Sep 17 00:00:00 2001 From: Insolita Date: Tue, 18 Nov 2014 04:56:40 +0800 Subject: [PATCH 3/3] Update jquery.the-modal.js --- jquery.the-modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.the-modal.js b/jquery.the-modal.js index fbefa0b..4deddf4 100644 --- a/jquery.the-modal.js +++ b/jquery.the-modal.js @@ -144,7 +144,7 @@ // close modal if opened if($('.'+localOptions.overlayClass).length) { - $.modal().close(); + $.themodal().close(); } var overlay = $('
').addClass(localOptions.overlayClass).prependTo('body'); @@ -166,7 +166,7 @@ if(localOptions.closeOnEsc) { $(document).bind('keyup.'+pluginNamespace, function(e){ if(e.keyCode === 27) { - $.modal().close(); + $.themodal().close(); } }); } @@ -176,7 +176,7 @@ e.stopPropagation(); }); $('.' + localOptions.overlayClass).on('click.' + pluginNamespace, function(e){ - $.modal().close(); + $.themodal().close(); }); }