diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 338868413e0..ac8d1249f22 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -283,3 +283,6 @@ .oe_seo_configuration .oe_remove { color: #e00101; } +.oe_seo_configuration .oe_seo_suggestion { + cursor: pointer; +} diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 8672c40439c..662268c6227 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -252,3 +252,5 @@ $remove_color: $icon_close width: 80% .oe_remove color: $remove_color + .oe_seo_suggestion + cursor: pointer diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index 34e65a9f731..67e089b627a 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -60,7 +60,9 @@ // default, primary, success, info, warning, danger this.type = options.type || 'default'; this._addToSelection = function (keyword) { - parent.addKeyword(keyword, parent.$el, 'info'); + if (_.isFunction(parent.addKeyword)) { + parent.addKeyword(keyword, parent.$el, 'info'); + } }; this._super(parent); }, @@ -155,10 +157,13 @@ } }, displayKeywordSuggestions: function (pageParser) { + var $modal = this.$el; var companyName = pageParser.company().toLowerCase(); var requestURL = "http://seo.eu01.aws.af.cm/suggest/" + encodeURIComponent(companyName); + $modal.find('.js_seo_company_suggestions').append("Loading..."); var self = this; $.getJSON(requestURL, function (list) { + $modal.find('.js_seo_company_suggestions').empty(); var nameRegex = new RegExp(companyName, "gi"); var cleanList = _.map(list, function (word) { return word.replace(nameRegex, "").trim(); @@ -168,7 +173,7 @@ if (keyword) { new website.seo.Suggestion(self, { keyword: keyword - }).appendTo($('.js_seo_company_suggestions')); + }).appendTo($modal.find('.js_seo_company_suggestions')); } }); }); diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index a151f9ecb7e..04b116b787d 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -145,7 +145,7 @@ -
  • +