From 13d54eb625bebbed2f294287a3ca03c06bbc93a0 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sun, 27 Dec 2015 17:11:28 +0100 Subject: [PATCH] better method naming --- js/addBookmarkView.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/addBookmarkView.js b/js/addBookmarkView.js index 381146fb..1c7664eb 100644 --- a/js/addBookmarkView.js +++ b/js/addBookmarkView.js @@ -13,14 +13,15 @@ var AddBookmarkView = OC.Backbone.View.extend({ initialize: function() { - _.bindAll(this, 'onAddBookmark', 'onTypeUrl', 'onAddBookmarkError'); + _.bindAll(this, 'onAddBookmark', 'updateAddButtonState', 'onAddBookmarkError'); view = this; - this.$el.find('#add_url').on('keydown keyup change click', view.onTypeUrl); + this.$el.find('#add_url').on('keydown keyup change click', view.updateAddButtonState); + this.updateAddButtonState(); }, - onTypeUrl: function() { + updateAddButtonState: function() { var button = this.$el.find('#bookmark_add_submit'); this.$el.off('submit'); if(!this.$el.find('#add_url').val().trim()) { @@ -77,7 +78,7 @@ resetElements: function() { this.$el.find('#bookmark_add_submit').addClass('icon-add'); this.$el.find('#bookmark_add_submit').removeClass('icon-loading-small'); - this.onTypeUrl(); + this.updateAddButtonState(); }