summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-19 08:53:04 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-19 08:53:04 +0100
commit5c149754137b05168c3b3a9872a15bd06f747ac3 (patch)
tree208e94c9dcf1cbe69794825688c9230a6c5d26a4
parent932bb827aed72ecc172a7a78d600effe579a067a (diff)
Add methods to get the ID of the currently selected tab
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--js/views/sidebarview.js9
-rw-r--r--js/views/tabview.js13
2 files changed, 22 insertions, 0 deletions
diff --git a/js/views/sidebarview.js b/js/views/sidebarview.js
index 6807eb767..5f5c1d68f 100644
--- a/js/views/sidebarview.js
+++ b/js/views/sidebarview.js
@@ -218,6 +218,15 @@
},
/**
+ * Returns the ID of the currently selected tab.
+ *
+ * @return {string} the ID of the currently selected tab.
+ */
+ getCurrentTabId: function() {
+ return this._tabView.getCurrentTabId();
+ },
+
+ /**
* Removes the tab for the given tabId.
*
* If the tab to be removed is the one currently selected and there are
diff --git a/js/views/tabview.js b/js/views/tabview.js
index a5ec42702..5de57cdbf 100644
--- a/js/views/tabview.js
+++ b/js/views/tabview.js
@@ -192,6 +192,10 @@
this.getChildView(this._currentTabId).setSelected(true);
this.triggerMethod('select:tabHeader', tabId);
+ },
+
+ getCurrentTabId: function() {
+ return this._currentTabId;
}
});
@@ -320,6 +324,15 @@
},
/**
+ * Returns the ID of the currently selected tab.
+ *
+ * @return {string} the ID of the currently selected tab.
+ */
+ getCurrentTabId: function() {
+ return this._tabHeadersView.getCurrentTabId();
+ },
+
+ /**
* Shows the content view associated to the selected tab header.
*
* Only for internal use as an event handler.