diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-09-23 13:06:18 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-09-23 13:06:18 +0200 |
| commit | be4b1b9b599d2dea07f68908b56a2c84ab8e5e5f (patch) | |
| tree | ab024b67ea4ffac2dfe32353f16e89e9024e34ed /addons/website/static/src/js/website.editor.js | |
| parent | 3e336cda542eddea94d6ad61eb748536f17c9a5b (diff) | |
[FIX] matching of site page URLs
With page urls not necessarily being full xmlids, match to result of
list_pages needs to take that in account to correctly infer a url is a
site page's.
bzr revid: xmo@openerp.com-20130923110618-ckicw4a5bpvatzie
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 77e031d352e..16443ac36c4 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -604,10 +604,15 @@ if (!href) { return; } var match, $control; - if (match = /(mailto):(.+)/.exec(href)) { - $control = this.$('input.email-address').val(match[2]); - } else if(href in this.pages) { + if (match = /mailto:(.+)/.exec(href)) { + $control = this.$('input.email-address').val(match[1]); + } else if (href in this.pages) { $control = this.$('select.existing').val(href); + } else if (match = /\/page\/(.+)/.exec(href)) { + var actual_href = '/page/website.' + match[1]; + if (actual_href in this.pages) { + $control = this.$('select.existing').val(actual_href); + } } if (!$control) { $control = this.$('input.url').val(href); |
