|
@@ -4,10 +4,9 @@ |
|
@@ -4,10 +4,9 @@ |
4
|
* @date: 2017/03/09
|
4
|
* @date: 2017/03/09
|
5
|
*/
|
5
|
*/
|
6
|
|
6
|
|
7
|
-/* global gDomains injected from client.hbs*/
|
7
|
+/* global gDomains injected from client.hbs*/ // eslint-disable-line
|
8
|
var $ = require('yoho-jquery');
|
8
|
var $ = require('yoho-jquery');
|
9
|
var Handlebars = require('yoho-handlebars');
|
9
|
var Handlebars = require('yoho-handlebars');
|
10
|
-var config = require('../../../config/common');
|
|
|
11
|
|
10
|
|
12
|
// dialog html
|
11
|
// dialog html
|
13
|
var $view = '<div class="mask-dialog preview-dialog">' +
|
12
|
var $view = '<div class="mask-dialog preview-dialog">' +
|
|
@@ -35,7 +34,9 @@ var $viewHbs = Handlebars.compile($view); |
|
@@ -35,7 +34,9 @@ var $viewHbs = Handlebars.compile($view); |
35
|
* @param cb 上传成功的回调
|
34
|
* @param cb 上传成功的回调
|
36
|
*/
|
35
|
*/
|
37
|
function Paste(sl, cb) {
|
36
|
function Paste(sl, cb) {
|
38
|
- if (typeof sl !== 'string') { return; }
|
37
|
+ if (typeof sl !== 'string') {
|
|
|
38
|
+ return;
|
|
|
39
|
+ }
|
39
|
this.$el = document.querySelector(sl);
|
40
|
this.$el = document.querySelector(sl);
|
40
|
this.formData = null;
|
41
|
this.formData = null;
|
41
|
this.uploadCb = cb;
|
42
|
this.uploadCb = cb;
|
|
@@ -143,7 +144,12 @@ Paste.prototype = { |
|
@@ -143,7 +144,12 @@ Paste.prototype = { |
143
|
},
|
144
|
},
|
144
|
|
145
|
|
145
|
open: function() {
|
146
|
open: function() {
|
|
|
147
|
+ var dh, vh = $(window).height();
|
|
|
148
|
+ var $main = $('.preview-dialog .dialog-main');
|
|
|
149
|
+
|
146
|
this.$preview.show();
|
150
|
this.$preview.show();
|
|
|
151
|
+ dh = $main.height();
|
|
|
152
|
+ $main.css('top', (vh - dh - 40) / 2);
|
147
|
},
|
153
|
},
|
148
|
|
154
|
|
149
|
close: function() {
|
155
|
close: function() {
|