From 7ab079bc52bb3e0daaf7258168c0c46c02766687 Mon Sep 17 00:00:00 2001 From: Inez Korczynski Date: Thu, 14 Jun 2012 15:00:29 -0700 Subject: [PATCH] Add ve.log, ve.debug and change rendering animation debug effect used in TextNode. --- modules/ve2/ce/nodes/ve.ce.TextNode.js | 8 ++++++-- modules/ve2/ve.js | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/ve2/ce/nodes/ve.ce.TextNode.js b/modules/ve2/ce/nodes/ve.ce.TextNode.js index 730c1e8e35..eb702a0b75 100644 --- a/modules/ve2/ce/nodes/ve.ce.TextNode.js +++ b/modules/ve2/ce/nodes/ve.ce.TextNode.js @@ -131,8 +131,12 @@ ve.ce.TextNode.prototype.onUpdate = function( force ) { this.$ = $new; if ( this.parent ) { this.parent.clean(); - // TODO: Remove before release or make it some debug variable dependent - //this.parent.$.css('display','none').fadeIn( 'fast' ); + if ( ve.debug ) { + this.parent.$.css('background-color', '#F6F6F6'); + setTimeout( ve.proxy( function() { + this.parent.$.css('background-color', 'transparent'); + }, this ), 350 ); + } } } }; diff --git a/modules/ve2/ve.js b/modules/ve2/ve.js index c21bdb6f75..1b2dc16122 100644 --- a/modules/ve2/ve.js +++ b/modules/ve2/ve.js @@ -276,3 +276,11 @@ ve.batchSplice = function( arr, offset, remove, data ) { ve.insertIntoArray = function( dst, offset, src ) { ve.batchSplice( dst, offset, 0, src ); }; + +ve.debug = true; + +ve.log = function() { + if ( ve.debug === true && window.console ) { + console.log.apply( console, arguments ); + } +};