Update deprecated jQuery functions
This patch replace uses of .bind(), .delegate(), and .unbind() with .on() and .off() respectively[1], in order to migrate to the latest version of jQuery. [1] https://jquery.com/upgrade-guide/3.0/#deprecated-bind-and-delegate Change-Id: I32c1fcd33db9af34a3f041e513a6a949c4921351
This commit is contained in:
parent
7d44796eca
commit
43a792ec94
@ -29,7 +29,7 @@
|
|||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
function link($scope, element, attrs, ngModel) {
|
function link($scope, element, attrs, ngModel) {
|
||||||
element.bind('change', function (event) {
|
element.on('change', function (event) {
|
||||||
var files = event.target.files;
|
var files = event.target.files;
|
||||||
var file = files[0];
|
var file = files[0];
|
||||||
ngModel.$setViewValue(file);
|
ngModel.$setViewValue(file);
|
||||||
|
@ -755,7 +755,7 @@ horizon.d3_line_chart = {
|
|||||||
* @param settings An object containing settings of the chart.
|
* @param settings An object containing settings of the chart.
|
||||||
*/
|
*/
|
||||||
var delegate_event_and_refresh_charts = function(selector, event_name, settings) {
|
var delegate_event_and_refresh_charts = function(selector, event_name, settings) {
|
||||||
$('form').delegate(selector, event_name, function() {
|
$('form').on(selector, event_name, function() {
|
||||||
/*
|
/*
|
||||||
Registering 'any event' on form element by delegating. This way it
|
Registering 'any event' on form element by delegating. This way it
|
||||||
can be easily overridden / enhanced when some special functionality
|
can be easily overridden / enhanced when some special functionality
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Added so that we can break Firefox and Safari bfcache to
|
// Added so that we can break Firefox and Safari bfcache to
|
||||||
// prevent loading previous page from cache.
|
// prevent loading previous page from cache.
|
||||||
horizon.addInitFunction(function () {
|
horizon.addInitFunction(function () {
|
||||||
$(window).bind('pageshow', function(event) {
|
$(window).on('pageshow', function(event) {
|
||||||
if (event.originalEvent.persisted) {
|
if (event.originalEvent.persisted) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ horizon.membership = {
|
|||||||
**/
|
**/
|
||||||
list_filtering: function (step_slug) {
|
list_filtering: function (step_slug) {
|
||||||
// remove previous lists' quicksearch events
|
// remove previous lists' quicksearch events
|
||||||
$('input.' + step_slug + '_filter').unbind();
|
$('input.' + step_slug + '_filter').off();
|
||||||
|
|
||||||
// set up quicksearch to filter on input
|
// set up quicksearch to filter on input
|
||||||
$('.' + step_slug + '_filterable').each(function () {
|
$('.' + step_slug + '_filterable').each(function () {
|
||||||
|
@ -38,7 +38,7 @@ var bootstrapWizardCreate = function(element, options) {
|
|||||||
|
|
||||||
this.rebindClick = function(selector, fn)
|
this.rebindClick = function(selector, fn)
|
||||||
{
|
{
|
||||||
selector.unbind('click', fn).bind('click', fn);
|
selector.off('click', fn).bind('click', fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fixNavigationButtons = function() {
|
this.fixNavigationButtons = function() {
|
||||||
|
@ -77,7 +77,7 @@ limitations under the License.
|
|||||||
scope.cols = 80;
|
scope.cols = 80;
|
||||||
scope.rows = 24;
|
scope.rows = 24;
|
||||||
// event handler to resize console according to window resize.
|
// event handler to resize console according to window resize.
|
||||||
angular.element(window).bind('resize', resizeTerminal);
|
angular.element(window).on('resize', resizeTerminal);
|
||||||
function resizeTerminal() {
|
function resizeTerminal() {
|
||||||
var terminal = angular.element('.terminal')[0];
|
var terminal = angular.element('.terminal')[0];
|
||||||
// take margin for scroll-bars on window.
|
// take margin for scroll-bars on window.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user