Authored by 李奇

粘贴发送优化

... ... @@ -4,10 +4,9 @@
* @date: 2017/03/09
*/
/* global gDomains injected from client.hbs*/
/* global gDomains injected from client.hbs*/ // eslint-disable-line
var $ = require('yoho-jquery');
var Handlebars = require('yoho-handlebars');
var config = require('../../../config/common');
// dialog html
var $view = '<div class="mask-dialog preview-dialog">' +
... ... @@ -35,7 +34,9 @@ var $viewHbs = Handlebars.compile($view);
* @param cb 上传成功的回调
*/
function Paste(sl, cb) {
if (typeof sl !== 'string') { return; }
if (typeof sl !== 'string') {
return;
}
this.$el = document.querySelector(sl);
this.formData = null;
this.uploadCb = cb;
... ... @@ -143,7 +144,12 @@ Paste.prototype = {
},
open: function() {
var dh, vh = $(window).height();
var $main = $('.preview-dialog .dialog-main');
this.$preview.show();
dh = $main.height();
$main.css('top', (vh - dh - 40) / 2);
},
close: function() {
... ...
... ... @@ -5,7 +5,7 @@
top: 0;
width: 100%;
height: 100%;
.dialog-mask {
position: fixed;
top: 0;
... ... @@ -15,13 +15,12 @@
z-index: 1070;
background-color: #000;
filter: alpha(opacity=50);
opacity: .4;
opacity: 0.4;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
}
.dialog-main {
position: relative;
top: 50px;
width: 600px;
padding: 20px;
z-index: 1100;
... ... @@ -55,7 +54,6 @@
max-height: 400px;
border: 1px solid #eee;
}
}
.foot-part {
... ... @@ -82,7 +80,6 @@
.cancel-btn {
color: #000;
}
}
}
}
... ...