From bad5bc37b2461db0c700d744cfa3e4bb61216dda Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Sun, 23 Jun 2013 13:37:29 -0400 Subject: [PATCH] Watch paste events on input fields. Fixes #730. --- main/webapp/modules/core/scripts/dialogs/clustering-dialog.js | 2 +- .../modules/core/scripts/dialogs/expression-preview-dialog.js | 2 +- .../core/scripts/dialogs/templating-exporter-dialog.js | 2 +- main/webapp/modules/core/scripts/facets/text-search-facet.js | 4 +++- .../default-importing-controller/file-selection-panel.js | 2 +- main/webapp/modules/core/scripts/project/history-panel.js | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js index 997af721a..7d22949d6 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js @@ -204,7 +204,7 @@ ClusteringDialog.prototype._renderTable = function(clusters) { var input = $('') .attr("value", cluster.value) - .keyup(function() { + .bind("keyup change input",function() { cluster.value = this.value; }).appendTo(tr.insertCell(4)); }; diff --git a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js index 85225a68d..1cdbe11e1 100644 --- a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js @@ -131,7 +131,7 @@ ExpressionPreviewDialog.Widget = function( var self = this; this._elmts.expressionPreviewTextarea .attr("value", this.expression) - .keyup(function(){ + .bind("keyup change input",function(){ self._scheduleUpdate(); }) .select() diff --git a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js index 6e1fb9237..4fb30f7e7 100644 --- a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js @@ -41,7 +41,7 @@ TemplatingExporterDialog.prototype._createDialog = function() { var self = this; var dialog = $(DOM.loadHTML("core", "scripts/dialogs/templating-exporter-dialog.html")); this._elmts = DOM.bind(dialog); - this._elmts.controls.find("textarea").keyup(function() { self._scheduleUpdate(); }); + this._elmts.controls.find("textarea").bind("keyup change input",function() { self._scheduleUpdate(); }); this._elmts.exportButton.click(function() { self._export(); self._dismiss(); }); this._elmts.cancelButton.click(function() { self._dismiss(); }); diff --git a/main/webapp/modules/core/scripts/facets/text-search-facet.js b/main/webapp/modules/core/scripts/facets/text-search-facet.js index 67cdcc6ed..fc3b43344 100644 --- a/main/webapp/modules/core/scripts/facets/text-search-facet.js +++ b/main/webapp/modules/core/scripts/facets/text-search-facet.js @@ -126,10 +126,12 @@ TextSearchFacet.prototype._initializeUI = function() { if (this._query) { elmts.input[0].value = this._query; } - elmts.input.keyup(function(evt) { + + elmts.input.bind("keyup change input",function(evt) { self._query = this.value; self._scheduleUpdate(); }).focus(); + }; TextSearchFacet.prototype.updateState = function(data) { diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js b/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js index e1871da69..6b54ff56a 100644 --- a/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js +++ b/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js @@ -231,7 +231,7 @@ Refine.DefaultImportingController.prototype._renderFileSelectionPanelControlPane this._updateFileSelectionSummary(); - this._fileSelectionPanelElmts.regexInput.unbind().keyup(function() { + this._fileSelectionPanelElmts.regexInput.unbind().bind("keyup change input",function() { var count = 0; var elmts = self._fileSelectionPanelElmts.filePanel .find(".default-importing-file-selection-filename") diff --git a/main/webapp/modules/core/scripts/project/history-panel.js b/main/webapp/modules/core/scripts/project/history-panel.js index 70ddc3b2f..2ed569297 100644 --- a/main/webapp/modules/core/scripts/project/history-panel.js +++ b/main/webapp/modules/core/scripts/project/history-panel.js @@ -131,7 +131,7 @@ HistoryPanel.prototype._render = function() { elmts.helpDiv.hide(); - elmts.filterInput.keyup(function() { + elmts.filterInput.bind("keyup change input",function() { var filter = $.trim(this.value.toLowerCase()); if (filter.length === 0) { elmts.bodyDiv.find(".history-entry").removeClass("filtered-out");