Skip to content

Commit

Permalink
fix editor css
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Sep 28, 2014
1 parent 3df6e1f commit 29c55b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion admin/editor-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,14 @@ function cacheResize() {
t.height(h * ow / w);
}

var to;
editor.hooks.chain('onPreviewRefresh', function () {
var diff = $('.diff', preview), scrolled = false;

if (to) {
clearTimeout(to);
}

$('img', preview).load(function () {
var t = $(this), src = t.attr('src');

Expand All @@ -191,7 +196,10 @@ function cacheResize() {

var changed = $('.diff', preview).parent();
if (!changed.is(preview)) {
changed.effect('highlight', {color : '#EEEEEE'}, 1000);
changed.css('background-color', 'rgba(255,230,0,0.5)');
to = setTimeout(function () {
changed.css('background-color', 'transparent');
}, 4500);
}

if (diff.length > 0) {
Expand Down

0 comments on commit 29c55b4

Please sign in to comment.