[Libreoffice-commits] online.git: loleaflet/dist

Pranav Kant pranavk at collabora.com
Tue Apr 19 16:50:06 UTC 2016


 loleaflet/dist/toolbar/toolbar.js |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit da7dd6f634dc4370dfcf974a57fc283a0b6ef5aa
Author: Pranav Kant <pranavk at collabora.com>
Date:   Tue Apr 19 22:08:09 2016 +0530

    loleaflet: Remove bunch of warnings from the console
    
    It is incorrect to add the <div> elements with parent as w2ui
    toolbar outside of onRefresh() method because toolbar can
    refresh multiple times during its lifetime meaning that all such
    added elements will be removed after first refresh breaking the
    font/back color feedback javascript code.
    
    Hence, this also fixes the font/back color feedback.
    
    Change-Id: Iacd4f8a5c8ebb64e5bba5e7f05ceef8b77051534

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 64f810b..7a33cf6 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -86,6 +86,12 @@ $(function () {
 		],
 		onClick: function (e) {
 			onClick(e.target);
+		},
+		onRefresh: function(e) {
+			var fontColorIndicator = L.DomUtil.create('div', 'font-color-indicator', L.DomUtil.get('tb_toolbar-up_item_fontcolor'));
+			fontColorIndicator.id = 'fontcolorindicator';
+			var backColorIndicator = L.DomUtil.create('div', 'back-color-indicator', L.DomUtil.get('tb_toolbar-up_item_backcolor'));
+			backColorIndicator.id = 'backcolorindicator';
 		}
 	});
 
@@ -157,10 +163,6 @@ $(function () {
 	$("#fontColorPicker").on("change.color", onColorPick);
 	$('#backColorPicker').colorpicker({showOn:'none', hideButton:true});
 	$("#backColorPicker").on("change.color", onColorPick);
-	var fontColorIndicator = L.DomUtil.create('div', 'font-color-indicator', L.DomUtil.get('tb_toolbar-up_item_fontcolor'));
-	fontColorIndicator.id = 'fontcolorindicator';
-	var backColorIndicator = L.DomUtil.create('div', 'back-color-indicator', L.DomUtil.get('tb_toolbar-up_item_backcolor'));
-	backColorIndicator.id = 'backcolorindicator';
 });
 
 var formatButtons = ['undo', 'redo', 'save',


More information about the Libreoffice-commits mailing list