Renaming feeds front-end.

This commit is contained in:
Samuel Clay 2010-03-28 18:41:31 -04:00
parent ffd370375c
commit 4b5510d1c1

View file

@ -25,6 +25,7 @@ NEWSBLUR.ReaderManageFeed.prototype = {
this.$manage.bind('click', $.rescope(this.handle_click, this));
this.$manage.bind('change', $.rescope(this.handle_change, this));
this.$manage.bind('keyup', $.rescope(this.handle_keyup, this));
},
initialize_feed: function(feed_id) {
@ -355,5 +356,16 @@ NEWSBLUR.ReaderManageFeed.prototype = {
var $submit = $('input[type=submit]', self.$manage);
$submit.removeClass("NB-disabled").removeAttr('disabled').attr('value', 'Save');
});
},
handle_keyup: function(elem, e) {
var self = this;
$.targetIs(e, { tagSelector: 'input', childOf: '.NB-manage-rename' }, function($t, $p) {
if ($t.val() != self.feed.feed_title) {
var $submit = $('input[type=submit]', self.$manage);
$submit.removeClass("NB-disabled").removeAttr('disabled').attr('value', 'Save');
}
});
}
};