Skip to content

Commit

Permalink
replace deprecated bind() calls
Browse files Browse the repository at this point in the history
The bind() call is deprecated in jQuery 3. This replaces it with
the on() call.
  • Loading branch information
splitbrain committed Nov 26, 2016
1 parent 568cdec commit 5170fe9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/scripts/edit.js
Expand Up @@ -85,7 +85,7 @@ function createPicker(id,props,edid){
var $btn = jQuery(document.createElement('button'))
.addClass('pickerbutton').attr('title', title)
.attr('aria-controls', edid)
.bind('click', bind(pickerInsert, title, edid))
.on('click', bind(pickerInsert, title, edid))
.appendTo($picker);
return $btn;
}
Expand Down Expand Up @@ -141,7 +141,7 @@ function pickerInsert(text,edid){
*/
function addBtnActionSignature($btn, props, edid) {
if(typeof SIG != 'undefined' && SIG != ''){
$btn.bind('click', function (e) {
$btn.on('click', function (e) {
insertAtCarret(edid,SIG);
e.preventDefault();
});
Expand Down
6 changes: 3 additions & 3 deletions lib/scripts/media.js
Expand Up @@ -628,7 +628,7 @@ var dw_mediamanager = {
$slider.slider("option", "max", 0.999);
$slider.slider("option", "step", 0.001);
$slider.slider("option", "value", 0.5);
$slider.bind("slide", function (event, ui) {
$slider.on("slide", function (event, ui) {
jQuery('#mediamanager__diff').find('div.imageDiff.opacity div.image2 img').css({opacity: $slider.slider("option", "value")});
});
},
Expand Down Expand Up @@ -668,7 +668,7 @@ var dw_mediamanager = {
$slider.slider("option", "max", 97);
$slider.slider("option", "step", 1);
$slider.slider("option", "value", 50);
$slider.bind("slide", function (event, ui) {
$slider.on("slide", function (event, ui) {
jQuery('#mediamanager__diff').find('div.imageDiff.portions div.image2').css({width: $slider.slider("option", "value") + '%'});
});
},
Expand Down Expand Up @@ -744,7 +744,7 @@ var dw_mediamanager = {

// remove old callback from the insert button and set the new one.
var $sendbtn = jQuery('#media__sendbtn');
$sendbtn.unbind().click(bind(dw_mediamanager.insert, id));
$sendbtn.off().click(bind(dw_mediamanager.insert, id));

dw_mediamanager.unforbid('ext');
if (ext === '.swf') {
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/toolbar.js
Expand Up @@ -44,7 +44,7 @@ function initToolbar(tbid,edid,tb, allowblock){
// type is a tb function -> assign it as onclick
actionFunc = 'tb_'+val.type;
if( jQuery.isFunction(window[actionFunc]) ){
$btn.bind('click', bind(window[actionFunc],$btn,val,edid) );
$btn.on('click', bind(window[actionFunc],$btn,val,edid) );
$toolbar.append($btn);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tpl/dokuwiki/script.js
Expand Up @@ -63,7 +63,7 @@ jQuery(function(){
dw_page.makeToggle('#dokuwiki__aside h3.toggle','#dokuwiki__aside div.content');

tpl_dokuwiki_mobile();
jQuery(window).bind('resize',
jQuery(window).on('resize',
function(){
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(tpl_dokuwiki_mobile,200);
Expand Down

0 comments on commit 5170fe9

Please sign in to comment.