作者 Karson

压缩打包JS

... ... @@ -13284,13 +13284,6 @@ define("drop", function(){});
/**
* http://git.oschina.net/hbbcs/bootStrap-addTabs
* Created by joe on 2015-12-19.
* @param {type} options {
* content string||html 直接指定内容
* close bool 是否可以关闭
* monitor 监视的区域
* }
*
* @returns
*/
$.fn.addtabs = function (options) {
var obj = $(this);
... ... @@ -13302,6 +13295,7 @@ $.fn.addtabs = function (options) {
tab: '.tab-addtabs',
iframeUse: true, //使用iframe还是ajax
iframeHeight: $(window).height() - 50, //固定TAB中IFRAME高度,根据需要自己修改
iframeForceRefresh: false, //点击后强制刷新对应的iframe
callback: function () {
//关闭后回调函数
}
... ... @@ -13318,7 +13312,7 @@ $.fn.addtabs = function (options) {
});
}
$(options.monitor).on('click', '[addtabs]', function (e) {
if ($(this).attr('url').indexOf("javascript") !== 0) {
if ($(this).attr('url').indexOf("javascript:") !== 0) {
if ($(this).is("a")) {
e.preventDefault();
}
... ... @@ -13337,7 +13331,7 @@ $.fn.addtabs = function (options) {
window.history.pushState(state, title, pushurl);
}
$(this).data("pushstate", null);
_add({
_add.call(this, {
id: id,
title: $(this).attr('title') ? $(this).attr('title') : $(this).html(),
content: content,
... ... @@ -13401,8 +13395,15 @@ $.fn.addtabs = function (options) {
navobj.append(title);
}
tabobj.append(content);
} else {
//强制刷新iframe
if (options.iframeForceRefresh) {
$("#" + conid + " iframe").attr('src', function (i, val) {
return val;
});
}
}
localStorage.setItem("addtabs", $(this).prop('outerHTML'));
//激活TAB
$("#" + tabid).addClass('active');
$("#" + conid).addClass("active");
... ... @@ -13410,8 +13411,8 @@ $.fn.addtabs = function (options) {
};
_close = function (id) {
var tabid = 'tab_'+id;
var conid = 'con_'+id;
var tabid = 'tab_' + id;
var conid = 'con_' + id;
//如果关闭的是当前激活的TAB,激活他的前一个TAB
if (obj.find("li.active").attr('id') == tabid) {
if ($("#" + tabid).prev().not(".tabdrop").size() > 0) {
... ...