summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-11-22 11:23:22 +0100
committerXavier Morel <xmo@openerp.com>2013-11-22 11:23:22 +0100
commit264fe7d98bb1fa28fde30cbe823e51b90d5e8eed (patch)
tree5b5a824baefd7747186df6898f11e864465fe76c /addons/website/static/src
parent1f2a40e3f78277a90b357b1e26d195bd548bec28 (diff)
[ADD] small transparency when hovering editable images, so [Edit] button stands out more
bzr revid: xmo@openerp.com-20131122102322-s776o3f80bku3f4a
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/website.editor.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index aedd5b011d9..cce7b09644a 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -103,19 +103,23 @@
top: $el.height() / 2 + image_top - $btn.outerHeight() / 2,
left: $el.width() / 2 + image_left - $btn.outerWidth() / 2,
});
+ $el.css('opacity', 0.75);
}).on('mouseleave', 'img', function (e) {
- var $button = $(previousSelection.$).next('button');
+ var $previous = $(previousSelection.$);
+ var $button = $previous.next('button');
$button.css('visibility', 'hidden');
var el = document.elementFromPoint(e.clientX, e.clientY);
$button.css('visibility', '');
if (el === this) { return; }
$button.remove();
+ $previous.css('opacity', '');
previousSelection = null;
});
editor.on('destroy', function (evt) {
- if (previousSelection) {
- $('.image-edit-button').remove();
- }
+ if (!previousSelection) { return; }
+ $('.image-edit-button')
+ .prev().css('opacity', '').end()
+ .remove();
});
//noinspection JSValidateTypes