This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化layer样式;优化drag插件滚动条获取;优化编辑器弹层定位

old
宇天 2017-09-28 10:28:16 +08:00
parent dfa5620d68
commit 0f772ee913
7 changed files with 17 additions and 16 deletions

View File

@ -97,8 +97,8 @@ define(['yua'], function(){
dy = cst[5] dy = cst[5]
//滚动条的偏移 //滚动条的偏移
bst = document.documentElement.scrollTop bst = $doc.scrollTop()
bsl = document.documentElement.scrollLeft bsl = $doc.scrollLeft()
// 计算元素的offset值, 需要修正 // 计算元素的offset值, 需要修正
ox = offset.left - dx - bsl ox = offset.left - dx - bsl

View File

@ -28,7 +28,7 @@ define(['yua', 'lib/drag/main', 'css!./skin/def'], function(yua){
shadeClose: false, //遮罩点击关闭弹窗 shadeClose: false, //遮罩点击关闭弹窗
radius: '0px', //弹窗圆角半径 radius: '0px', //弹窗圆角半径
area: ['auto', 'auto'], area: ['auto', 'auto'],
title: '', //弹窗主标题(在工具栏上的) title: '提示', //弹窗主标题(在工具栏上的)
menubar: true, //是否显示菜单栏 menubar: true, //是否显示菜单栏
content: '', // 弹窗的内容 content: '', // 弹窗的内容
fixed: false, //是否固定不可拖拽 fixed: false, //是否固定不可拖拽

File diff suppressed because one or more lines are too long

View File

@ -29,12 +29,12 @@
/* 弹层标题栏 */ /* 弹层标题栏 */
.layer-title {width:100%;height:40px;padding:0 8px;line-height:40px;background:nth($cp, 2);font-size:14px;color:nth($cgr, 1);} .layer-title {width:100%;height:43px;padding:0 8px;line-height:43px;background:#f5f5f5;font-size:16px;color:nth($cgr, 1);}
.action-min, .action-min,
.action-close {position:absolute;display:block;top:10px;width:20px;height:20px;line-height:20px;border:0;text-align:center;cursor:pointer;color:nth($cgr, 2); .action-close {position:absolute;display:block;top:12px;width:20px;height:20px;line-height:20px;font-size:14px;text-align:center;cursor:pointer;color:nth($cgr, 2);
&:hover {border: 1px solid #ddd;line-height: 18px;color:nth($cg, 1);} &:hover {color:nth($cg, 1);}
} }
.action-min {right:40px; .action-min {right:40px;
&::before {content:"\e634"} &::before {content:"\e634"}
@ -64,7 +64,7 @@
/* 弹层按钮部分 */ /* 弹层按钮部分 */
.layer-btns {width:100%;height:40px;padding:0 5px;line-height:30px;font-size:14px;color:#454545;text-align:right; .layer-btns {width:100%;height:40px;padding:0 5px;line-height:30px;font-size:14px;color:#454545;text-align:right;
a {display:inline-block;width:auto;min-width:60px;height:30px;margin:0 5px;padding:0 10px;color:nth($cgr, 1);text-align:center;background:nth($cp, 1); a {display:inline-block;width:auto;min-width:60px;height:30px;margin:0 5px;padding:0 10px;color:nth($cgr, 1);text-align:center;background:nth($cp, 1);@include ts();
&:hover {background:nth($cp, 2)} &:hover {background:nth($cp, 2)}
&:active {background:nth($cp, 3)} &:active {background:nth($cp, 3)}

View File

@ -314,7 +314,7 @@ define([
menubar: false, menubar: false,
shade: false, shade: false,
fixed: true, fixed: true,
offset: [offset.top + 37 - document.documentElement.scrollTop], offset: [offset.top + 37 - ME.doc.scrollTop()],
tab: 2, tab: 2,
attach: '', attach: '',
attachAlt: '', attachAlt: '',

View File

@ -42,7 +42,7 @@ define(['lib/layer/base'], function(){
ME.insert(vm.$editor, wrap, true) ME.insert(vm.$editor, wrap, true)
layer.close(h1ID) layer.close(h1ID)
}, },
offset: [offset.top + 37 - document.documentElement.scrollTop, 'auto', 'auto', offset.left - document.documentElement.scrollLeft], offset: [offset.top + 37 - ME.doc.scrollTop(), 'auto', 'auto', offset.left - ME.doc.scrollLeft()],
content: '<ul class="do-meditor-h1 do-fn-noselect meditor-font">' content: '<ul class="do-meditor-h1 do-fn-noselect meditor-font">'
+ '<li :click="$insert(1)" class="h1">一级标题</li>' + '<li :click="$insert(1)" class="h1">一级标题</li>'
+ '<li :click="$insert(2)" class="h2">二级标题</li>' + '<li :click="$insert(2)" class="h2">二级标题</li>'
@ -121,7 +121,7 @@ define(['lib/layer/base'], function(){
ME.insert(vm.$editor, val, false) ME.insert(vm.$editor, val, false)
layer.close(layid) layer.close(layid)
}, },
offset: [offset.top + 37 - document.documentElement.scrollTop, 'auto', 'auto', offset.left - document.documentElement.scrollLeft], offset: [offset.top + 37 - ME.doc.scrollTop(), 'auto', 'auto', offset.left - ME.doc.scrollLeft()],
content: '<div class="do-meditor-common meditor-font">' content: '<div class="do-meditor-common meditor-font">'
+ '<section><span class="label">链接文字</span>' + '<section><span class="label">链接文字</span>'
+ '<input class="input" :duplex="linkName" />' + '<input class="input" :duplex="linkName" />'
@ -151,7 +151,7 @@ define(['lib/layer/base'], function(){
fixed: true, fixed: true,
shadeClose: true, shadeClose: true,
arr: getOrderArr(36), arr: getOrderArr(36),
offset: [offset.top + 37 - document.documentElement.scrollTop, 'auto', 'auto', offset.left - document.documentElement.scrollLeft], offset: [offset.top + 37 - ME.doc.scrollTop(), 'auto', 'auto', offset.left - ME.doc.scrollLeft()],
content: '<ul class="do-meditor-face">' content: '<ul class="do-meditor-face">'
+ '<li class="item" :repeat="arr" ><img :attr-src="ME.path + \'/addon/face/\' + el + \'.gif\'" :click="$insert(this.src)" /></li>' + '<li class="item" :repeat="arr" ><img :attr-src="ME.path + \'/addon/face/\' + el + \'.gif\'" :click="$insert(this.src)" /></li>'
+ '</ul>', + '</ul>',
@ -168,7 +168,7 @@ define(['lib/layer/base'], function(){
title: '0行 x 0列', title: '0行 x 0列',
fixed: true, fixed: true,
shadeClose: true, shadeClose: true,
offset: [offset.top + 37 - document.documentElement.scrollTop, 'auto', 'auto', offset.left - document.documentElement.scrollLeft], offset: [offset.top + 37 - ME.doc.scrollTop(), 'auto', 'auto', offset.left - ME.doc.scrollLeft()],
matrix: objArr(10).map(function(){return objArr(10)}), matrix: objArr(10).map(function(){return objArr(10)}),
content: '<ul class="do-meditor-table">' content: '<ul class="do-meditor-table">'
+ '<li :repeat="matrix"><span :repeat-o="el" :class="{active: o.v}" :data="{x: $index, y: $outer.$index}"></span></li>' + '<li :repeat="matrix"><span :repeat-o="el" :class="{active: o.v}" :data="{x: $index, y: $outer.$index}"></span></li>'
@ -239,7 +239,7 @@ define(['lib/layer/base'], function(){
ME.insert(vm.$editor, val, false) ME.insert(vm.$editor, val, false)
layer.close(layid) layer.close(layid)
}, },
offset: [offset.top + 37 - document.documentElement.scrollTop, 'auto', 'auto', offset.left - document.documentElement.scrollLeft], offset: [offset.top + 37 - ME.doc.scrollTop(), 'auto', 'auto', offset.left - ME.doc.scrollLeft()],
content: '<div class="do-meditor-common meditor-font">' content: '<div class="do-meditor-common meditor-font">'
+ '<section><span class="label">图片描述</span>' + '<section><span class="label">图片描述</span>'
+ '<input class="input" :duplex="imgAlt" />' + '<input class="input" :duplex="imgAlt" />'
@ -340,7 +340,7 @@ define(['lib/layer/base'], function(){
layer.open({ layer.open({
type: 7, type: 7,
title: '关于编辑器', title: '关于编辑器',
offset: [offset.top + 37 - document.documentElement.scrollTop], offset: [offset.top + 37 - ME.doc.scrollTop()],
content: '<div class="do-meditor-about meditor-font">' content: '<div class="do-meditor-about meditor-font">'
+ '<pre>' + '<pre>'
+ ' __ __ _____ _ _ _\n' + ' __ __ _____ _ _ _\n'

View File

@ -152,7 +152,8 @@ define([
} }
} }
return null return null
} },
doc: yua(document)
} }
//获取真实的引用路径,避免因为不同的目录结构导致加载失败的情况 //获取真实的引用路径,避免因为不同的目录结构导致加载失败的情况
for(var i in yua.modules){ for(var i in yua.modules){