Skip to content

Commit d3a2648

Browse files
committed
Use on and off function instead of bind and unbind (jQuery 1.7)
1 parent 29ef228 commit d3a2648

6 files changed

Lines changed: 14 additions & 14 deletions

js/jquery.nyroModal.filters.form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jQuery(function($, undefined) {
1818
},
1919
init: function(nm) {
2020
nm.loadFilter = 'form';
21-
nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal', function(e) {
21+
nm.opener.off('submit.nyroModal').on('submit.nyroModal', function(e) {
2222
e.preventDefault();
2323
nm.opener.trigger('nyroModal');
2424
});

js/jquery.nyroModal.filters.formFile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jQuery(function($, undefined) {
2222
init: function(nm) {
2323
nm.loadFilter = 'formFile';
2424
nm.store.formFileLoading = false;
25-
nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal', function(e) {
25+
nm.opener.off('submit.nyroModal').on('submit.nyroModal', function(e) {
2626
if (!nm.store.formFileIframe) {
2727
e.preventDefault();
2828
nm.opener.trigger('nyroModal');
@@ -55,7 +55,7 @@ jQuery(function($, undefined) {
5555
if (nm.store.formFileLoading) {
5656
nm.store.formFileLoading = false;
5757
var content = nm.store.formFileIframe
58-
.unbind('load error')
58+
.off('load error')
5959
.contents().find('body').not('script[src]');
6060
if (content && content.html() && content.html().length) {
6161
rmFormFileElts();
@@ -66,7 +66,7 @@ jQuery(function($, undefined) {
6666
fct = function() {
6767
nbTry++;
6868
var content = nm.store.formFileIframe
69-
.unbind('load error')
69+
.off('load error')
7070
.contents().find('body').not('script[src]');
7171
if (content && content.html() && content.html().length) {
7272
nm._setCont(content.html(), nm.store.form.sel);

js/jquery.nyroModal.filters.gallery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jQuery(function($, undefined) {
6262
href: '#'
6363
})
6464
.addClass('nyroModalPrev')
65-
.bind('click', function(e) {
65+
.on('click', function(e) {
6666
e.preventDefault();
6767
nm._callFilters('galleryPrev');
6868
})
@@ -75,7 +75,7 @@ jQuery(function($, undefined) {
7575
href: '#'
7676
})
7777
.addClass('nyroModalNext')
78-
.bind('click', function(e) {
78+
.on('click', function(e) {
7979
e.preventDefault();
8080
nm._callFilters('galleryNext');
8181
})

js/jquery.nyroModal.filters.iframeForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jQuery(function($, undefined) {
2323
nm.loadFilter = 'iframeForm';
2424
nm.store.iframeFormLoading = false;
2525
nm.store.iframeFormOrgTarget = nm.opener.attr('target');
26-
nm.opener.unbind('submit.nyroModal').bind('submit.nyroModal', function(e) {
26+
nm.opener.off('submit.nyroModal').on('submit.nyroModal', function(e) {
2727
if (!nm.store.iframeFormIframe) {
2828
e.preventDefault();
2929
nm.opener.trigger('nyroModal');

js/jquery.nyroModal.filters.link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jQuery(function($, undefined) {
1818
},
1919
init: function(nm) {
2020
nm.loadFilter = 'link';
21-
nm.opener.unbind('click.nyroModal').bind('click.nyroModal', function(e) {
21+
nm.opener.off('click.nyroModal').on('click.nyroModal', function(e) {
2222
e.preventDefault();
2323
nm.opener.trigger('nyroModal');
2424
});

js/jquery.nyroModal.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ jQuery(function($, undefined) {
522522
if (_internal.firstInit) {
523523
_internal._container = $('<div />').appendTo($b);
524524
$w.smartresize($.proxy(_internal._resize, _internal));
525-
$d.bind('keydown.nyroModal', $.proxy(_internal._keyHandler, _internal));
525+
$d.on('keydown.nyroModal', $.proxy(_internal._keyHandler, _internal));
526526
_internal._calculateFullSize();
527527
_internal.firstInit = false;
528528
}
@@ -587,8 +587,8 @@ jQuery(function($, undefined) {
587587
nm._callFilters('initFilters');
588588
nm._callFilters('init');
589589
nm.opener
590-
.unbind('nyroModal.nyroModal nmClose.nyroModal nmResize.nyroModal')
591-
.bind({
590+
.off('nyroModal.nyroModal nmClose.nyroModal nmResize.nyroModal')
591+
.on({
592592
'nyroModal.nyroModal': function(e) { nm.open(); return false;},
593593
'nmClose.nyroModal': function() { nm.close(); return false;},
594594
'nmResize.nyroModal': function() { nm.resize(); return false;}
@@ -791,7 +791,7 @@ jQuery(function($, undefined) {
791791
initElts: function(nm) {
792792
nm.elts.bg.addClass('nyroModalBg');
793793
if (nm.closeOnClick)
794-
nm.elts.bg.unbind('click.nyroModal').bind('click.nyroModal', function(e) {
794+
nm.elts.bg.off('click.nyroModal').on('click.nyroModal', function(e) {
795795
e.preventDefault();
796796
nm.close();
797797
});
@@ -810,7 +810,7 @@ jQuery(function($, undefined) {
810810
var cur = $(this);
811811
cur.nyroModal(nm.getForNewLinks(cur), true);
812812
}).end()
813-
.find('.nyroModalClose').bind('click.nyroModal', function(e) {
813+
.find('.nyroModalClose').on('click.nyroModal', function(e) {
814814
e.preventDefault();
815815
nm.close();
816816
});
@@ -880,7 +880,7 @@ jQuery(function($, undefined) {
880880
};
881881
};
882882
// smartresize
883-
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
883+
jQuery.fn[sr] = function(fn){ return fn ? this.on('resize', debounce(fn)) : this.trigger(sr); };
884884

885885
})(jQuery,'smartresize');
886886
// ucFirst

0 commit comments

Comments
 (0)