diff --git a/src/components/pager/js/Pager.js b/src/components/pager/js/Pager.js index 2f6a79963e..730d14cf95 100644 --- a/src/components/pager/js/Pager.js +++ b/src/components/pager/js/Pager.js @@ -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; }); diff --git a/src/components/reorderer/js/GeometricManager.js b/src/components/reorderer/js/GeometricManager.js index 531769c001..f9b99f555c 100644 --- a/src/components/reorderer/js/GeometricManager.js +++ b/src/components/reorderer/js/GeometricManager.js @@ -310,7 +310,7 @@ 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 () { @@ -318,7 +318,7 @@ var fluid_2_0_0 = fluid_2_0_0 || {}; }; that.endDrag = function () { - $("body").unbind("mousemove.fluid-dropManager"); + $("body").off("mousemove.fluid-dropManager"); }; that.mouseMove = function (evt) { diff --git a/src/components/reorderer/js/Reorderer.js b/src/components/reorderer/js/Reorderer.js index 80a52faa8c..26dfde927f 100644 --- a/src/components/reorderer/js/Reorderer.js +++ b/src/components/reorderer/js/Reorderer.js @@ -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); @@ -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); @@ -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) diff --git a/src/components/tabs/js/Tabs.js b/src/components/tabs/js/Tabs.js index 4b75176c12..956ac92024 100644 --- a/src/components/tabs/js/Tabs.js +++ b/src/components/tabs/js/Tabs.js @@ -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); }); }); diff --git a/src/components/textfieldSlider/js/TextfieldSlider.js b/src/components/textfieldSlider/js/TextfieldSlider.js index cbecfff8af..2c4f28551a 100644 --- a/src/components/textfieldSlider/js/TextfieldSlider.js +++ b/src/components/textfieldSlider/js/TextfieldSlider.js @@ -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"] } }, diff --git a/src/components/uploader/js/FileQueueView.js b/src/components/uploader/js/FileQueueView.js index e90a0d3add..bdc3c07651 100644 --- a/src/components/uploader/js/FileQueueView.js +++ b/src/components/uploader/js/FileQueueView.js @@ -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); }; diff --git a/src/framework/core/js/FluidDocument.js b/src/framework/core/js/FluidDocument.js index 24774bbc5b..0244929ed6 100644 --- a/src/framework/core/js/FluidDocument.js +++ b/src/framework/core/js/FluidDocument.js @@ -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; }); diff --git a/src/framework/core/js/FluidView.js b/src/framework/core/js/FluidView.js index d64e3314eb..45991988be 100644 --- a/src/framework/core/js/FluidView.js +++ b/src/framework/core/js/FluidView.js @@ -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)); diff --git a/src/framework/core/js/jquery.keyboard-a11y.js b/src/framework/core/js/jquery.keyboard-a11y.js index 4686018dbb..80ede16c86 100644 --- a/src/framework/core/js/jquery.keyboard-a11y.js +++ b/src/framework/core/js/jquery.keyboard-a11y.js @@ -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); @@ -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; });