From a84591b13b97140e6aa26ca05396a4e1ab06a72f Mon Sep 17 00:00:00 2001 From: wengmx Date: Wed, 25 Jun 2014 09:10:22 +0800 Subject: [PATCH 1/5] =?UTF-8?q?NavTab=E7=9A=84=E5=90=84=E4=B8=AA=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E8=B0=83=E6=95=B4=E4=B8=BA=E5=9C=A8=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E5=90=8E=E6=89=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tab/navtab.js | 7 +++++++ src/tab/navtabitem.js | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/tab/navtab.js b/src/tab/navtab.js index 8ed76fa..613c7b7 100644 --- a/src/tab/navtab.js +++ b/src/tab/navtab.js @@ -508,6 +508,8 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ }, //设置当前选中的标签 _setItemActived:function(item){ + + var _self = this, preActivedItem = _self.getActivedItem(); if(item === preActivedItem){ @@ -522,6 +524,11 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ if(!item.get('actived')){ item.set('actived',true); } + var tabContentEl = item.__view.get('tabContentEl'); + var tabContentIframe = $('iframe',tabContentEl); + if(tabContentIframe.attr('src')!=item.get('href')){ + tabContentIframe.attr('src',item.get('href')); + } //当标签项可见时,否则无法计算位置信息 if(item.get('visible')){ _self._scrollToItem(item); diff --git a/src/tab/navtabitem.js b/src/tab/navtabitem.js index c879b26..37ec3c8 100644 --- a/src/tab/navtabitem.js +++ b/src/tab/navtabitem.js @@ -34,12 +34,7 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ this._setHref(v); }, _setHref : function(href){ - var _self = this, - tabContentEl = _self.get('tabContentEl'); - href = href || _self.get('href'); - if(tabContentEl){ - $('iframe',tabContentEl).attr('src',href); - } + var _self = this; }, resetHref : function(){ this._setHref(); @@ -55,6 +50,7 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ var _self = this, el = _self.get('el'); + _self.setTabContentVisible(v); if(v){ el.addClass(CLS_NAV_ACTIVED); @@ -179,6 +175,12 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ */ reload : function(){ this.get('view').resetHref(); + var _self = this; + var tabContentEl = _self.__view.get('tabContentEl'); + if(tabContentEl){ + $('iframe',tabContentEl).attr('src',_self.get('href')); + } + }, /** * @protected From a326d9d0c9ed6d6422b58d22241c3d571b6a66eb Mon Sep 17 00:00:00 2001 From: wengmx Date: Tue, 21 Oct 2014 11:30:24 +0800 Subject: [PATCH 2/5] =?UTF-8?q?Revert=20"NavTab=E7=9A=84=E5=90=84=E4=B8=AA?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E8=B0=83=E6=95=B4=E4=B8=BA=E5=9C=A8=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E5=90=8E=E6=89=8D=E5=8A=A0=E8=BD=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a84591b13b97140e6aa26ca05396a4e1ab06a72f. --- src/tab/navtab.js | 7 ------- src/tab/navtabitem.js | 14 ++++++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/tab/navtab.js b/src/tab/navtab.js index 613c7b7..8ed76fa 100644 --- a/src/tab/navtab.js +++ b/src/tab/navtab.js @@ -508,8 +508,6 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ }, //设置当前选中的标签 _setItemActived:function(item){ - - var _self = this, preActivedItem = _self.getActivedItem(); if(item === preActivedItem){ @@ -524,11 +522,6 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ if(!item.get('actived')){ item.set('actived',true); } - var tabContentEl = item.__view.get('tabContentEl'); - var tabContentIframe = $('iframe',tabContentEl); - if(tabContentIframe.attr('src')!=item.get('href')){ - tabContentIframe.attr('src',item.get('href')); - } //当标签项可见时,否则无法计算位置信息 if(item.get('visible')){ _self._scrollToItem(item); diff --git a/src/tab/navtabitem.js b/src/tab/navtabitem.js index 37ec3c8..c879b26 100644 --- a/src/tab/navtabitem.js +++ b/src/tab/navtabitem.js @@ -34,7 +34,12 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ this._setHref(v); }, _setHref : function(href){ - var _self = this; + var _self = this, + tabContentEl = _self.get('tabContentEl'); + href = href || _self.get('href'); + if(tabContentEl){ + $('iframe',tabContentEl).attr('src',href); + } }, resetHref : function(){ this._setHref(); @@ -50,7 +55,6 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ var _self = this, el = _self.get('el'); - _self.setTabContentVisible(v); if(v){ el.addClass(CLS_NAV_ACTIVED); @@ -175,12 +179,6 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ */ reload : function(){ this.get('view').resetHref(); - var _self = this; - var tabContentEl = _self.__view.get('tabContentEl'); - if(tabContentEl){ - $('iframe',tabContentEl).attr('src',_self.get('href')); - } - }, /** * @protected From 1b2d59e8ebc7b97b73008bc27baae89d165ce465 Mon Sep 17 00:00:00 2001 From: wengmx Date: Tue, 21 Oct 2014 11:42:08 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=85=B6=E5=AE=83tab?= =?UTF-8?q?=E9=A1=B5=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=85=81=E8=AE=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E8=AE=BE=E7=BD=AE=E4=B8=BA=E4=B8=8D=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=9A=84tab=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tab/navtab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tab/navtab.js b/src/tab/navtab.js index 8ed76fa..0accc5c 100644 --- a/src/tab/navtab.js +++ b/src/tab/navtab.js @@ -331,7 +331,7 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ var _self = this, children = _self.get('children'); BUI.each(children,function(item){ - if(curItem !==item){ + if(curItem !==item&&item.get('closeable')){ item.close(); } From f413bbb1e732f9fae07a48c4371c6d9ae5ae4cfb Mon Sep 17 00:00:00 2001 From: wengmx Date: Tue, 28 Oct 2014 17:26:57 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=90=8E=EF=BC=8CNavTabItem=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E7=8A=B6=E6=80=81=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tab/navtab.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tab/navtab.js b/src/tab/navtab.js index 0accc5c..493c53d 100644 --- a/src/tab/navtab.js +++ b/src/tab/navtab.js @@ -1,4 +1,4 @@ -/** +/** * @fileOverview 导航标签 * @author dxq613@gmail.com * @ignore @@ -320,10 +320,13 @@ define('bui/tab/navtab',['bui/common','bui/menu'],function(require){ }, closeAll:function(){ var _self = this, - children = _self.get('children'); + children = _self.get('children'),actived; BUI.each(children,function(item){ if(item.get('closeable')){ item.close(); + }else if(!actived){ + _self.setActived(item.get('id')); + actived = true; } }); }, From 15a2e1ac1b4694459c4fffcb7808f71f6876878b Mon Sep 17 00:00:00 2001 From: wengmx Date: Tue, 18 Nov 2014 18:39:06 +0800 Subject: [PATCH 5/5] =?UTF-8?q?navtab=E5=A2=9E=E5=8A=A0title=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tab/navtabitem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tab/navtabitem.js b/src/tab/navtabitem.js index c879b26..195a578 100644 --- a/src/tab/navtabitem.js +++ b/src/tab/navtabitem.js @@ -49,7 +49,7 @@ define('bui/tab/navtabitem',['bui/common'],function(requrie){ var _self = this, el = _self.get('el'); //el.attr('title',v); - $('.' + CLS_ITEM_TITLE,el).html(v); + $('.' + CLS_ITEM_TITLE,el).html(v).attr("title",v); }, _uiSetActived : function(v){ var _self = this,