编辑器开启粘贴图片自动上传
This commit is contained in:
parent
2c15a55113
commit
0a3990ae54
@ -31,31 +31,9 @@ layui.define(['element'], function (exports) {
|
||||
$('#GouguAppBody').append('<div class="gg-tab-page" title="'+title+'" id="tabItem' + id + '" data-id="' + id + '"><iframe id="' + id + '" data-frameid="' + id + '" src="' + url + '" frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe></div>');
|
||||
this.tabChange(id);
|
||||
},
|
||||
//从子页面打开新的Tab页面,如果为传入id,防止id重复,使用时间戳作为唯一标识
|
||||
sonAdd: function (url, title, id) {
|
||||
if (typeof(id) == "undefined") {
|
||||
id = Date.now();
|
||||
}
|
||||
if ($(".layui-tab-title li[lay-id]").length <= 0) {
|
||||
//打开新的tab项
|
||||
tab.tabAdd(id, url, title);
|
||||
} else {
|
||||
//否则判断该tab项是否以及存在
|
||||
var isHas = false;
|
||||
$.each($(".layui-tab-title li[lay-id]"), function () {
|
||||
//如果点击左侧菜单栏所传入的id 在右侧tab项中的lay-id属性可以找到,则说明该tab项已经打开
|
||||
if ($(this).attr("lay-id") == id) {
|
||||
isHas = true;
|
||||
$('[data-frameid="' + id + '"]').attr('src', url);
|
||||
//最后不管是否新增tab,最后都转到要打开的选项页面上
|
||||
tab.tabChange(id);
|
||||
}
|
||||
})
|
||||
if (isHas == false) {
|
||||
//标志为false 新增一个tab项
|
||||
tab.tabAdd(id, url, title);
|
||||
}
|
||||
}
|
||||
//从子页面打开新的Tab页面,防止id重复,使用时间戳作为唯一标识
|
||||
sonAdd: function (url, title,id) {
|
||||
this.tabAdd( id, url,title);
|
||||
},
|
||||
//根据传入的id传入到指定的tab项,并滚动定位
|
||||
tabChange: function (id) {
|
||||
|
@ -13,7 +13,7 @@ layui.define([], function (exports) {
|
||||
selector: '#gouguedit',
|
||||
quickbars_insert_toolbar:'',
|
||||
quickbars_selection_toolbar: 'cut copy | bold italic underline strikethrough ',
|
||||
plugins: 'code quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools',
|
||||
plugins: 'code quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools paste',
|
||||
toolbar: 'code undo redo | forecolor backcolor bold italic underline strikethrough removeformat | alignleft aligncenter alignright alignjustify outdent indent | bullist numlist table blockquote link image media codesample | formatselect fontselect fontsizeselect',
|
||||
resize: false,
|
||||
elementpath: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user