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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri May 1 15:40:24 UTC 2020


 loleaflet/src/control/Control.JSDialogBuilder.js |   10 +++++-----
 loleaflet/src/control/Control.Notebookbar.js     |   11 ++++++-----
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit d0f5989994701f6fe3aadf038798a78dadc8aad5
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Apr 24 12:44:05 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 1 17:40:04 2020 +0200

    jsdialog: identify tabs by id not label
    
    Change-Id: Ia695020b5c8afadff8031983c29c527c2ed177dd
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93273
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 675a084d1..dcb1531bf 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -605,7 +605,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
-	_createTabClick: function(builder, t, tabs, contentDivs, labels)
+	_createTabClick: function(builder, t, tabs, contentDivs, tabIds)
 	{
 		return function() {
 			$(tabs[t]).addClass('selected');
@@ -617,7 +617,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				}
 			}
 			$(contentDivs[t]).show();
-			builder.wizard.selectedTab(labels[t]);
+			builder.wizard.selectedTab(tabIds[t]);
 		};
 	},
 
@@ -629,7 +629,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 			var tabs = [];
 			var contentDivs = [];
-			var labels = [];
+			var tabIds = [];
 			for (var tabIdx = 0; tabIdx < data.tabs.length; tabIdx++) {
 				var item = data.tabs[tabIdx];
 
@@ -640,10 +640,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				if (data.selected == data.tabs[tabIdx].id)
 					$(tab).addClass('selected');
 				tabs[tabIdx] = tab;
+				tabIds[tabIdx] = tab.id;
 
 				var label = L.DomUtil.create('span', 'ui-tab-content ' + builder.options.cssClass + ' unolabel', tab);
 				label.innerHTML = title;
-				labels[tabIdx] = title;
 
 				var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, contentsContainer);
 				contentDiv.title = title;
@@ -659,7 +659,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 					// to get capture of 't' right has to be a sub fn.
 					var fn = function(id) {
 						return function() {
-							builder._createTabClick(builder, id, tabs, contentDivs, labels)();
+							builder._createTabClick(builder, id, tabs, contentDivs, tabIds)();
 							builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder);
 						};
 					};
diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js
index ad36e4972..43a680834 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -32,24 +32,25 @@ L.Control.Notebookbar = L.Control.extend({
 	},
 
 	selectedTab: function(tabText) {
+		console.log(tabText);
 		switch (tabText) {
-		case 'Home':
+		case 'HomeLabel':
 			this.loadTab(this.getHomeTab());
 			break;
 
-		case 'Insert':
+		case 'InsertLabel':
 			this.loadTab(this.getInsertTab());
 			break;
 
-		case 'Layout':
+		case 'LayoutLabel':
 			this.loadTab(this.getLayoutTab());
 			break;
 		
-		case 'References':
+		case 'ReferencesLabel':
 			this.loadTab(this.getReferencesTab());
 			break;
 
-		case 'Table':
+		case 'TableLabel':
 			this.loadTab(this.getTableTab());
 			break;
 		}


More information about the Libreoffice-commits mailing list