Skip to content

Commit

Permalink
FLUID-5825: replace deprected bind/unbind with on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Sep 19, 2016
1 parent d73bde7 commit a693450
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/components/pager/js/Pager.js
Expand Up @@ -33,8 +33,8 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
};

fluid.pager.bindLinkClick = function (link, initiatePageChange, eventArg) {
link.unbind("click.fluid.pager");
link.bind("click.fluid.pager", function () {
link.off("click.fluid.pager");
link.on("click.fluid.pager", function () {
initiatePageChange.fire(eventArg);
return false;
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/reorderer/js/GeometricManager.js
Expand Up @@ -310,15 +310,15 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
lastClosest = null;
displacementX = dX;
displacementY = dY;
$("body").bind("mousemove.fluid-dropManager", that.mouseMove);
$("body").on("mousemove.fluid-dropManager", that.mouseMove);
};

that.lastPosition = function () {
return lastClosest;
};

that.endDrag = function () {
$("body").unbind("mousemove.fluid-dropManager");
$("body").off("mousemove.fluid-dropManager");
};

that.mouseMove = function (evt) {
Expand Down
10 changes: 5 additions & 5 deletions src/components/reorderer/js/Reorderer.js
Expand Up @@ -444,9 +444,9 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
var activeItem = $(thatReorderer.activeItem);

// Fixes FLUID-3288.
// Need to unbind the blur event as safari will call blur on movements.
// Need to remove the blur event as safari will call blur on movements.
// This caused the user to have to double tap the arrow keys to move.
activeItem.unbind("blur.fluid.reorderer");
activeItem.off("blur.fluid.reorderer");

thatReorderer.events.onMove.fire(item, requestedPosition);
thatReorderer.dropManager.geometricMove(item, requestedPosition.element, requestedPosition.position);
Expand Down Expand Up @@ -522,7 +522,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
if (!$.data(selectable[0], "fluid.reorderer.selectable-initialised")) {
selectable.addClass(thatReorderer.options.styles.defaultStyle);

selectable.bind("blur.fluid.reorderer", handleBlur);
selectable.on("blur.fluid.reorderer", handleBlur);
selectable.focus(handleFocus);
selectable.click(handleClick);

Expand Down Expand Up @@ -915,9 +915,9 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
// unsupported, NON-API function
fluid.reorderer.labeller.onMove = function (that, item) {
fluid.clear(that.movedMap); // if we somehow were fooled into missing a defocus, at least clear the map on a 2nd move
// This unbind is needed for FLUID-4693 with Chrome 18, which generates a focusOut when
// This "off" is needed for FLUID-4693 with Chrome 18, which generates a focusOut when
// simply doing the DOM manipulation to move the element to a new position.
$(item).unbind("focusout.ariaLabeller");
$(item).off("focusout.ariaLabeller");
var movingId = fluid.allocateSimpleId(item);
that.movedMap[movingId] = {
oldRender: that.renderLabel(item)
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/js/Tabs.js
Expand Up @@ -45,7 +45,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {};

fluid.tabs.bindEvents = function (that) { // TODO: The test cases for this component do not exercise any of these events
fluid.each(that.options.events, function (value, eventName) {
that.container.bind(eventName, function (event, ui) {
that.container.on(eventName, function (event, ui) {
return that.events[eventName].fire(that, event, ui);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/textfieldSlider/js/TextfieldSlider.js
Expand Up @@ -250,7 +250,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
},
"onCreate.bindSlideEvt": {
"this": "{that}.slider",
"method": "bind",
"method": "on",
"args": ["slide", "{that}.setModel"]
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/uploader/js/FileQueueView.js
Expand Up @@ -242,7 +242,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {};

// update the click event and the styling for the file delete button
var removeRowBtn = that.locate("fileIconBtn", row);
removeRowBtn.unbind("click");
removeRowBtn.off("click");
removeRowBtn.removeClass(that.options.styles.remove);
removeRowBtn.attr("title", that.options.strings.status.success);
};
Expand Down
2 changes: 1 addition & 1 deletion src/framework/core/js/FluidDocument.js
Expand Up @@ -100,7 +100,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {};

var lastFocusedElement = null;

$(document).bind("focusin", function (event) {
$(document).on("focusin", function (event) {
lastFocusedElement = event.target;
});

Expand Down
6 changes: 3 additions & 3 deletions src/framework/core/js/FluidView.js
Expand Up @@ -645,14 +645,14 @@ var fluid_2_0_0 = fluid_2_0_0 || {};
fluid.each(that.options.exclusions, function (exclusion) {
exclusion = $(exclusion);
fluid.each(exclusion, function (excludeEl) {
$(excludeEl).bind("focusin", that.canceller).
bind("fluid-focus", that.canceller).
$(excludeEl).on("focusin", that.canceller).
on("fluid-focus", that.canceller).
click(that.canceller).mousedown(that.canceller);
// Mousedown is added for FLUID-4212, as a result of Chrome bug 6759, 14204
});
});
if (!that.options.cancelByDefault) {
$(control).bind("focusout", function (event) {
$(control).on("focusout", function (event) {
fluid.log("Starting blur timer for element " + fluid.dumpEl(event.target));
var now = fluid.now();
fluid.log("back delay: " + (now - that.lastCancel));
Expand Down
14 changes: 7 additions & 7 deletions src/framework/core/js/jquery.keyboard-a11y.js
Expand Up @@ -423,13 +423,13 @@ var fluid = fluid || fluid_2_0_0;
if (typeof(that.options.selectablesTabindex) === "number") {
that.selectables.fluid("tabindex", that.options.selectablesTabindex);
}
that.selectables.unbind("focus." + CONTEXT_KEY);
that.selectables.unbind("blur." + CONTEXT_KEY);
that.selectables.bind("focus." + CONTEXT_KEY, selectableFocusHandler(that));
that.selectables.bind("blur." + CONTEXT_KEY, selectableBlurHandler(that));
that.selectables.off("focus." + CONTEXT_KEY);
that.selectables.off("blur." + CONTEXT_KEY);
that.selectables.on("focus." + CONTEXT_KEY, selectableFocusHandler(that));
that.selectables.on("blur." + CONTEXT_KEY, selectableBlurHandler(that));
if (keyMap && that.options.noBubbleListeners) {
that.selectables.unbind("keydown." + CONTEXT_KEY);
that.selectables.bind("keydown." + CONTEXT_KEY, arrowKeyHandler(that, keyMap));
that.selectables.off("keydown." + CONTEXT_KEY);
that.selectables.on("keydown." + CONTEXT_KEY, arrowKeyHandler(that, keyMap));
}
if (focusedItem) {
selectElement(focusedItem, that);
Expand Down Expand Up @@ -591,7 +591,7 @@ var fluid = fluid || fluid_2_0_0;
var binding = bindings[i];
elements.keydown(makeActivationHandler(binding));
}
elements.bind("fluid-activate", function (evt, handler) {
elements.on("fluid-activate", function (evt, handler) {
handler = handler || onActivateHandler;
return handler ? handler(evt) : null;
});
Expand Down

0 comments on commit a693450

Please sign in to comment.