剔除页签操作功能

dep_wangsr
RuoYi 6 years ago committed by Limy
parent 858235519e
commit 27427c37d9

@ -3,149 +3,180 @@
* 新增支持IE全屏显示 * 新增支持IE全屏显示
* Copyright (c) 2019 ruoyi * Copyright (c) 2019 ruoyi
*/ */
(function(jQuery) {
/*jshint browser: true, jquery: true */
(function($){ /**
"use strict"; * Sets or gets the fullscreen state.
*
// These helper functions available only to our plugin scope. * @param {boolean=} state
function supportFullScreen(){ * True to enable fullscreen mode, false to disable it. If not
var doc = document.documentElement; * specified then the current fullscreen state is returned.
* @return {boolean|Element|jQuery|null}
return ('requestFullscreen' in doc) || * When querying the fullscreen state then the current fullscreen
('msRequestFullscreen' in doc) || * element (or true if browser doesn't support it) is returned
('mozRequestFullScreen' in doc && document.mozFullScreenEnabled) || * when browser is currently in full screen mode. False is returned
('webkitRequestFullScreen' in doc); * if browser is not in full screen mode. Null is returned if
} * browser doesn't support fullscreen mode at all. When setting
* the fullscreen state then the current jQuery selection is
function requestFullScreen(elem){ * returned for chaining.
if (elem.requestFullscreen) { * @this {jQuery}
elem.requestFullscreen(); */
} else if (elem.mozRequestFullScreen) { function fullScreen(state)
elem.mozRequestFullScreen(); {
} else if (elem.webkitRequestFullScreen) { var e, func, doc;
elem.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (elem.msRequestFullscreen) { // Do nothing when nothing was selected
elem.msRequestFullscreen(); if (!this.length) return this;
}
} // We only use the first selected element because it doesn't make sense
// to fullscreen multiple elements.
function fullScreenStatus(){ e = (/** @type {Element} */ this[0]);
return document.fullscreen ||
document.mozFullScreen || // Find the real element and the document (Depends on whether the
document.webkitIsFullScreen || // document itself or a HTML element was selected)
document.msFullscreenElement || if (e.ownerDocument)
false; {
} doc = e.ownerDocument;
}
function cancelFullScreen(){ else
if (document.exitFullscreen) { {
document.exitFullscreen(); doc = e;
} else if (document.mozCancelFullScreen) { e = doc.documentElement;
document.mozCancelFullScreen(); }
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen(); // When no state was specified then return the current state.
} else if (document.msExitFullscreen) { if (state == null)
document.msExitFullscreen(); {
} // When fullscreen mode is not supported then return null
} if (!((/** @type {?Function} */ doc["exitFullscreen"])
|| (/** @type {?Function} */ doc["webkitExitFullscreen"])
function onFullScreenEvent(callback){ || (/** @type {?Function} */ doc["webkitCancelFullScreen"])
$(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange", function(){ || (/** @type {?Function} */ doc["msExitFullscreen"])
// The full screen status is automatically || (/** @type {?Function} */ doc["mozCancelFullScreen"])))
// passed to our callback as an argument. {
callback(fullScreenStatus()); return null;
}); }
}
// Check fullscreen state
// Adding a new test to the jQuery support object state = !!doc["fullscreenElement"]
$.support.fullscreen = supportFullScreen(); || !!doc["msFullscreenElement"]
|| !!doc["webkitIsFullScreen"]
// Creating the plugin || !!doc["mozFullScreen"];
$.fn.fullScreen = function(props){ if (!state) return state;
if(!$.support.fullscreen || this.length !== 1) {
// The plugin can be called only // Return current fullscreen element or "true" if browser doesn't
// on one element at a time // support this
return (/** @type {?Element} */ doc["fullscreenElement"])
return this; || (/** @type {?Element} */ doc["webkitFullscreenElement"])
} || (/** @type {?Element} */ doc["webkitCurrentFullScreenElement"])
|| (/** @type {?Element} */ doc["msFullscreenElement"])
if(fullScreenStatus()){ || (/** @type {?Element} */ doc["mozFullScreenElement"])
// if we are already in fullscreen, exit || state;
cancelFullScreen(); }
return this;
} // When state was specified then enter or exit fullscreen mode.
if (state)
// You can potentially pas two arguments a color {
// for the background and a callback function // Enter fullscreen
func = (/** @type {?Function} */ e["requestFullscreen"])
var options = $.extend({ || (/** @type {?Function} */ e["webkitRequestFullscreen"])
'background' : '#111', || (/** @type {?Function} */ e["webkitRequestFullScreen"])
'callback' : $.noop( ), || (/** @type {?Function} */ e["msRequestFullscreen"])
'fullscreenClass' : 'fullScreen' || (/** @type {?Function} */ e["mozRequestFullScreen"]);
}, props), if (func)
{
elem = this, func.call(e);
}
// This temporary div is the element that is return this;
// actually going to be enlarged in full screen }
else
fs = $('<div>', { {
'css' : { // Exit fullscreen
'overflow-y' : 'auto', func = (/** @type {?Function} */ doc["exitFullscreen"])
'background' : options.background, || (/** @type {?Function} */ doc["webkitExitFullscreen"])
'width' : '100%', || (/** @type {?Function} */ doc["webkitCancelFullScreen"])
'height' : '100%' || (/** @type {?Function} */ doc["msExitFullscreen"])
} || (/** @type {?Function} */ doc["mozCancelFullScreen"]);
}) if (func) func.call(doc);
.insertBefore(elem) return this;
.append(elem); }
}
// You can use the .fullScreen class to
// apply styling to your element /**
elem.addClass( options.fullscreenClass ); * Toggles the fullscreen mode.
*
// Inserting our element in the temporary * @return {!jQuery}
// div, after which we zoom it in fullscreen * The jQuery selection for chaining.
* @this {jQuery}
requestFullScreen(fs.get(0)); */
function toggleFullScreen()
fs.click(function(e){ {
if(e.target == this){ return (/** @type {!jQuery} */ fullScreen.call(this,
// If the black bar was clicked !fullScreen.call(this)));
cancelFullScreen(); }
}
}); /**
* Handles the browser-specific fullscreenchange event and triggers
elem.cancel = function(){ * a jquery event for it.
cancelFullScreen(); *
return elem; * @param {?Event} event
}; * The fullscreenchange event.
*/
onFullScreenEvent(function(fullScreen){ function fullScreenChangeHandler(event)
if(!fullScreen){ {
// We have exited full screen. jQuery(document).trigger(new jQuery.Event("fullscreenchange"));
// Detach event listener }
$(document).off( 'fullscreenchange mozfullscreenchange webkitfullscreenchange' );
// Remove the class and destroy /**
// the temporary div * Handles the browser-specific fullscreenerror event and triggers
* a jquery event for it.
elem.removeClass( options.fullscreenClass ).insertBefore(fs); *
fs.remove(); * @param {?Event} event
} * The fullscreenerror event.
*/
// Calling the facultative user supplied callback function fullScreenErrorHandler(event)
if(options.callback) { {
options.callback(fullScreen); jQuery(document).trigger(new jQuery.Event("fullscreenerror"));
} }
});
/**
return elem; * Installs the fullscreenchange event handler.
}; */
function installFullScreenHandlers()
$.fn.cancelFullScreen = function( ) { {
cancelFullScreen(); var e, change, error;
return this; // Determine event name
}; e = document;
}(jQuery)); if (e["webkitCancelFullScreen"])
{
change = "webkitfullscreenchange";
error = "webkitfullscreenerror";
}
else if (e["msExitFullscreen"])
{
change = "MSFullscreenChange";
error = "MSFullscreenError";
}
else if (e["mozCancelFullScreen"])
{
change = "mozfullscreenchange";
error = "mozfullscreenerror";
}
else
{
change = "fullscreenchange";
error = "fullscreenerror";
}
// Install the event handlers
jQuery(document).bind(change, fullScreenChangeHandler);
jQuery(document).bind(error, fullScreenErrorHandler);
}
jQuery.fn["fullScreen"] = fullScreen;
jQuery.fn["toggleFullScreen"] = toggleFullScreen;
installFullScreenHandlers();
})(jQuery);

@ -3313,7 +3313,7 @@ nav.page-tabs .page-tabs-content {
} }
.roll-right.tabRight { .roll-right.tabRight {
right: 140px; right: 60px;
} }
.roll-right.btn-group { .roll-right.btn-group {

@ -139,14 +139,14 @@ $(function() {
//查看左侧隐藏的选项卡 //查看左侧隐藏的选项卡
function scrollTabLeft() { function scrollTabLeft() {
var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')) + 50); var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')));
// 可视区域非tab宽度 // 可视区域非tab宽度
var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs")); var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs"));
//可视区域tab宽度 //可视区域tab宽度
var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth; var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
//实际滚动宽度 //实际滚动宽度
var scrollVal = 0; var scrollVal = 0;
if (($(".page-tabs-content").width() + 50) < visibleWidth) { if (($(".page-tabs-content").width()) < visibleWidth) {
return false; return false;
} else { } else {
var tabElement = $(".menuTab:first"); var tabElement = $(".menuTab:first");
@ -425,7 +425,7 @@ $(function() {
// 全屏显示 // 全屏显示
$('#fullScreen').on('click', function () { $('#fullScreen').on('click', function () {
$('#wrapper').fullScreen(); $(document).toggleFullScreen();
}); });
// 刷新按钮 // 刷新按钮
@ -533,7 +533,8 @@ $(function() {
icon: "fa-arrows-alt", icon: "fa-arrows-alt",
callback: function(key, opt) { callback: function(key, opt) {
setActiveTab(this); setActiveTab(this);
opt.$trigger.find('i').trigger("dblclick"); var target = $('.RuoYi_iframe[data-id="' + this.data('id') + '"]');
target.fullScreen(true);
} }
}, },
"refresh": { "refresh": {

@ -55,7 +55,7 @@
</li> </li>
<li th:each="menu : ${menus}"> <li th:each="menu : ${menus}">
<a href="#"> <a href="#">
<i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i> <i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
<span class="nav-label" th:text="${menu.menuName}">一级菜单</span> <span class="nav-label" th:text="${menu.menuName}">一级菜单</span>
<span class="fa arrow"></span> <span class="fa arrow"></span>
</a> </a>
@ -86,7 +86,7 @@
<ul class="nav navbar-top-links navbar-right welcome-message"> <ul class="nav navbar-top-links navbar-right welcome-message">
<li><a title="视频教程" href="http://doc.ruoyi.vip/#/standard/spjc" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li> <li><a title="视频教程" href="http://doc.ruoyi.vip/#/standard/spjc" target="_blank"><i class="fa fa-video-camera"></i> 视频教程</a></li>
<li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li> <li><a title="开发文档" href="http://doc.ruoyi.vip" target="_blank"><i class="fa fa-question-circle"></i> 开发文档</a></li>
<li><a title="全屏显示" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li> <li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
<li class="dropdown user-menu"> <li class="dropdown user-menu">
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown"> <a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}" class="user-image"> <img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}" class="user-image">
@ -123,17 +123,6 @@
<button class="roll-nav roll-right tabRight"> <button class="roll-nav roll-right tabRight">
<i class="fa fa-forward"></i> <i class="fa fa-forward"></i>
</button> </button>
<div class="btn-group roll-nav roll-right">
<button class="dropdown J_tabClose" data-toggle="dropdown">
页签操作<span class="caret"></span>
</button>
<ul role="menu" class="dropdown-menu dropdown-menu-right">
<li><a class="tabCloseCurrent" href="javascript:void();">关闭当前</a></li>
<li><a class="tabCloseOther" href="javascript:void();">关闭其他</a></li>
<li><a class="tabCloseAll" href="javascript:void();">全部关闭</a></li>
<li><a class="tabMaxCurrent" href="javascript:void();">全屏显示</a></li>
</ul>
</div>
<a href="#" class="roll-nav roll-right tabReload"><i class="fa fa-refresh"></i> 刷新</a> <a href="#" class="roll-nav roll-right tabReload"><i class="fa fa-refresh"></i> 刷新</a>
</div> </div>

Loading…
Cancel
Save