From 252be1b9ab6ed01f7fb30b6f1628dadcb3690307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 23 Apr 2014 16:20:34 +0200 Subject: [PATCH] [FIX] website_forum: various fixes and usability improvements - question title is now a link - fixed a crash when trying to see badges in the 'new badge' notification - improved the tags manager: manage tag at blur event (otherwise the last tag was ften not created) + manage already-existing tags bzr revid: tde@openerp.com-20140423142034-5si58h4jgd1jyyem --- addons/website_forum/static/src/js/website_forum.js | 9 +++++++-- addons/website_forum/views/website_forum.xml | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 9053c573efb..e84e76e14fa 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -129,11 +129,16 @@ $(document).ready(function () { cacheResults: true } }); - // Note: Adding event handler of whitespaceKeyDown event. - $("input.load_tags").bind("whitespaceKeyDown",function () { + // Adds: create tags on space + blur + $("input.load_tags").on('whitespaceKeyDown blur', function () { $(this).textext()[0].tags().addTags([ $(this).val() ]); $(this).val(""); }); + $("input.load_tags").on('isTagAllowed', function(e, data) { + if (_.indexOf($(this).textext()[0].tags()._formData, data.tag) != -1) { + data.result = false; + } + }); } if ($('textarea.load_editor').length) { diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 9af62b8a56a..8e01555e638 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -80,7 +80,7 @@
- View Your Badges + View Your Badges
@@ -414,7 +414,7 @@

- + [Deleted] [Closed]