Bug 666209 - Add method to check if a tab is an AppTab. r=gmealer mozilla-aurora
authorHenrik Skupin <hskupin@mozilla.com>
Thu, 23 Jun 2011 00:56:03 +0200
branchmozilla-aurora
changeset 1326 72227ed4f874
parent 1319 ca37244027b5
child 1330 1269a42b420d
push id1198
push userhskupin@mozilla.com
push date2011-06-22 23:11 +0000
reviewersgmealer
bugs666209
Bug 666209 - Add method to check if a tab is an AppTab. r=gmealer
lib/tabs.js
--- a/lib/tabs.js
+++ b/lib/tabs.js
@@ -345,16 +345,27 @@ tabBrowser.prototype = {
   getTab : function tabBrowser_getTab(index) {
     if (index === undefined)
       index = this.selectedIndex;
 
     return this.getElement({type: "tabs_tab", subtype: "index", value: index});
   },
 
   /**
+   * Check if the specified tab is an AppTab
+   *
+   * @param {ElemBase} tab
+   *        Index of the tab
+   * @returns {Boolean} True if the tab is an AppTab
+   */
+  isAppTab : function tabBrowser_isAppTab(tab) {
+    return tab.getNode().hasAttribute('pinned');
+  },
+
+  /**
    * Creates the child element of the tab's notification bar
    *
    * @param {number} tabIndex
    *        (Optional) Index of the tab to check
    * @param {string} elemString
    *        (Optional) Lookup string of the notification bar's child element
    * @return The created child element
    * @type {ElemBase}