压缩打包JS

pull/27/head
Karson 2017-12-01 20:17:20 +08:00
parent c156a472cc
commit 3ece8a3102
1 changed files with 13 additions and 12 deletions

View File

@ -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");