Add SEO keyword with [ENTER]
authorddm <ddm@openerp.com>
Tue, 27 Aug 2013 08:37:21 +0000 (10:37 +0200)
committerddm <ddm@openerp.com>
Tue, 27 Aug 2013 08:37:21 +0000 (10:37 +0200)
bzr revid: ddm@openerp.com-20130827083721-k49j8z0t081ig2p0

addons/website/static/src/js/website.js

index 41dc7e0..e785b0f 100644 (file)
     website.seo.Configurator = openerp.Widget.extend({
         template: 'website.seo_configuration',
         events: {
+            'keypress input[name=seo_page_keywords]': 'confirmKeyword',
             'click button[data-action=add]': 'addKeyword',
             'click a[data-action=update]': 'update',
             'hidden': 'close'
 
             this.$el.modal();
         },
+        confirmKeyword: function (e) {
+            if (e.keyCode == 13) {
+                this.addKeyword();
+                this.$el.find('input[name=seo_page_keywords]').val("");
+            }
+        },
         addKeyword: function () {
             var word = this.$el.find('input[name=seo_page_keywords]').val();
             new website.seo.Keyword({