Browse Source

Merge pull request #583 in VISUAL/fineui from ~GUY/fineui:master to master

* commit '171825121c6adda63ab21fd4a8cffe64d47d66b6':
  整理
es6
guy 6 years ago
parent
commit
f435df9fbd
  1. 306
      dist/base.js
  2. 306
      dist/bundle.js
  3. 6
      dist/bundle.min.js
  4. 306
      dist/fineui.js
  5. 6
      dist/fineui.min.js
  6. 2
      dist/utils.min.js
  7. 304
      src/base/foundation/message.js

306
dist/base.js vendored

@ -5062,180 +5062,178 @@ BI.shortcut("bi.el", BI.EL);/**
* 弹出提示消息框用于模拟阻塞操作通过回调函数实现 * 弹出提示消息框用于模拟阻塞操作通过回调函数实现
* @class BI.Msg * @class BI.Msg
*/ */
$.extend(BI, { BI.Msg = function () {
Msg: function () {
var messageShow, $mask, $pop; var messageShow, $mask, $pop;
return { return {
alert: function (title, message, callback) { alert: function (title, message, callback) {
this._show(false, title, message, callback); this._show(false, title, message, callback);
}, },
confirm: function (title, message, callback) { confirm: function (title, message, callback) {
this._show(true, title, message, callback); this._show(true, title, message, callback);
}, },
prompt: function (title, message, value, callback, min_width) { prompt: function (title, message, value, callback, min_width) {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
options = options || {}; options = options || {};
context = context || $("body"); context = context || $("body");
var level = options.level || "normal"; var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose; var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({ var toast = BI.createWidget({
type: "bi.toast", type: "bi.toast",
cls: "bi-message-animate bi-message-leave", cls: "bi-message-animate bi-message-leave",
level: level, level: level,
autoClose: autoClose, autoClose: autoClose,
text: message text: message
}); });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: context, element: context,
items: [{ items: [{
el: toast, el: toast,
left: "50%", left: "50%",
top: 10 top: 10
}] }]
}); });
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () { autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () { BI.delay(function () {
toast.destroy(); toast.destroy();
}, 1000); }, 1000);
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({ $mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 2, zIndex: BI.zIndex_tip - 2,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
opacity: 0.5 opacity: 0.5
}).appendTo("body"); }).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({ $pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 1, zIndex: BI.zIndex_tip - 1,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}).appendTo("body"); }).appendTo("body");
var close = function () { var close = function () {
messageShow.destroy(); messageShow.destroy();
$mask.remove(); $mask.remove();
}; };
var controlItems = []; var controlItems = [];
if (hasCancel === true) { if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
}
controlItems.push({ controlItems.push({
el: { el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () { handler: function () {
close(); close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [true]); callback.apply(null, [false]);
} }
} }
} }
}); });
var conf = { }
element: $pop, controlItems.push({
type: "bi.center_adapt", el: {
items: [ type: "bi.button",
{ text: BI.i18nText("BI-Basic_OK"),
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", close();
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [true]);
el: { }
type: "bi.border", }
cls: "bi-message-title bi-background", }
items: { });
center: { var conf = {
el: { element: $pop,
type: "bi.label", type: "bi.center_adapt",
text: title || BI.i18nText("BI-Basic_Prompt"), items: [
textAlign: "left", {
hgap: 20, type: "bi.border",
height: 50 cls: "bi-message-content bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
}
},
width: 60
}
} }
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
} }
}, },
south: { height: 50
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: { type: "bi.text",
type: "bi.right_vertical_adapt", cls: "bi-message-text",
hgap: 5, tgap: 60,
items: controlItems hgap: 20,
}, lineHeight: 30,
top: 0, whiteSpace: "normal",
left: 20, text: message
right: 20,
bottom: 0
}]
},
height: 60
} }
}, },
width: 400, south: {
height: 300 el: {
} type: "bi.absolute",
] items: [{
}; el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
messageShow = BI.createWidget(conf); },
} height: 60
}; }
}() },
});/** width: 400,
height: 300
}
]
};
messageShow = BI.createWidget(conf);
}
};
}();/**
* GridView * GridView
* *
* Created by GUY on 2016/1/11. * Created by GUY on 2016/1/11.

306
dist/bundle.js vendored

@ -40332,180 +40332,178 @@ BI.shortcut("bi.el", BI.EL);/**
* 弹出提示消息框用于模拟阻塞操作通过回调函数实现 * 弹出提示消息框用于模拟阻塞操作通过回调函数实现
* @class BI.Msg * @class BI.Msg
*/ */
$.extend(BI, { BI.Msg = function () {
Msg: function () {
var messageShow, $mask, $pop; var messageShow, $mask, $pop;
return { return {
alert: function (title, message, callback) { alert: function (title, message, callback) {
this._show(false, title, message, callback); this._show(false, title, message, callback);
}, },
confirm: function (title, message, callback) { confirm: function (title, message, callback) {
this._show(true, title, message, callback); this._show(true, title, message, callback);
}, },
prompt: function (title, message, value, callback, min_width) { prompt: function (title, message, value, callback, min_width) {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
options = options || {}; options = options || {};
context = context || $("body"); context = context || $("body");
var level = options.level || "normal"; var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose; var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({ var toast = BI.createWidget({
type: "bi.toast", type: "bi.toast",
cls: "bi-message-animate bi-message-leave", cls: "bi-message-animate bi-message-leave",
level: level, level: level,
autoClose: autoClose, autoClose: autoClose,
text: message text: message
}); });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: context, element: context,
items: [{ items: [{
el: toast, el: toast,
left: "50%", left: "50%",
top: 10 top: 10
}] }]
}); });
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () { autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () { BI.delay(function () {
toast.destroy(); toast.destroy();
}, 1000); }, 1000);
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({ $mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 2, zIndex: BI.zIndex_tip - 2,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
opacity: 0.5 opacity: 0.5
}).appendTo("body"); }).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({ $pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 1, zIndex: BI.zIndex_tip - 1,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}).appendTo("body"); }).appendTo("body");
var close = function () { var close = function () {
messageShow.destroy(); messageShow.destroy();
$mask.remove(); $mask.remove();
}; };
var controlItems = []; var controlItems = [];
if (hasCancel === true) { if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
}
controlItems.push({ controlItems.push({
el: { el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () { handler: function () {
close(); close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [true]); callback.apply(null, [false]);
} }
} }
} }
}); });
var conf = { }
element: $pop, controlItems.push({
type: "bi.center_adapt", el: {
items: [ type: "bi.button",
{ text: BI.i18nText("BI-Basic_OK"),
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", close();
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [true]);
el: { }
type: "bi.border", }
cls: "bi-message-title bi-background", }
items: { });
center: { var conf = {
el: { element: $pop,
type: "bi.label", type: "bi.center_adapt",
text: title || BI.i18nText("BI-Basic_Prompt"), items: [
textAlign: "left", {
hgap: 20, type: "bi.border",
height: 50 cls: "bi-message-content bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
}
},
width: 60
}
} }
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
} }
}, },
south: { height: 50
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: { type: "bi.text",
type: "bi.right_vertical_adapt", cls: "bi-message-text",
hgap: 5, tgap: 60,
items: controlItems hgap: 20,
}, lineHeight: 30,
top: 0, whiteSpace: "normal",
left: 20, text: message
right: 20,
bottom: 0
}]
},
height: 60
} }
}, },
width: 400, south: {
height: 300 el: {
} type: "bi.absolute",
] items: [{
}; el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
messageShow = BI.createWidget(conf); },
} height: 60
}; }
}() },
});/** width: 400,
height: 300
}
]
};
messageShow = BI.createWidget(conf);
}
};
}();/**
* GridView * GridView
* *
* Created by GUY on 2016/1/11. * Created by GUY on 2016/1/11.

6
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

306
dist/fineui.js vendored

@ -40553,180 +40553,178 @@ BI.shortcut("bi.el", BI.EL);/**
* 弹出提示消息框用于模拟阻塞操作通过回调函数实现 * 弹出提示消息框用于模拟阻塞操作通过回调函数实现
* @class BI.Msg * @class BI.Msg
*/ */
$.extend(BI, { BI.Msg = function () {
Msg: function () {
var messageShow, $mask, $pop; var messageShow, $mask, $pop;
return { return {
alert: function (title, message, callback) { alert: function (title, message, callback) {
this._show(false, title, message, callback); this._show(false, title, message, callback);
}, },
confirm: function (title, message, callback) { confirm: function (title, message, callback) {
this._show(true, title, message, callback); this._show(true, title, message, callback);
}, },
prompt: function (title, message, value, callback, min_width) { prompt: function (title, message, value, callback, min_width) {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
options = options || {}; options = options || {};
context = context || $("body"); context = context || $("body");
var level = options.level || "normal"; var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose; var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({ var toast = BI.createWidget({
type: "bi.toast", type: "bi.toast",
cls: "bi-message-animate bi-message-leave", cls: "bi-message-animate bi-message-leave",
level: level, level: level,
autoClose: autoClose, autoClose: autoClose,
text: message text: message
}); });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: context, element: context,
items: [{ items: [{
el: toast, el: toast,
left: "50%", left: "50%",
top: 10 top: 10
}] }]
}); });
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () { autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () { BI.delay(function () {
toast.destroy(); toast.destroy();
}, 1000); }, 1000);
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({ $mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 2, zIndex: BI.zIndex_tip - 2,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
opacity: 0.5 opacity: 0.5
}).appendTo("body"); }).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({ $pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 1, zIndex: BI.zIndex_tip - 1,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}).appendTo("body"); }).appendTo("body");
var close = function () { var close = function () {
messageShow.destroy(); messageShow.destroy();
$mask.remove(); $mask.remove();
}; };
var controlItems = []; var controlItems = [];
if (hasCancel === true) { if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
}
controlItems.push({ controlItems.push({
el: { el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () { handler: function () {
close(); close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [true]); callback.apply(null, [false]);
} }
} }
} }
}); });
var conf = { }
element: $pop, controlItems.push({
type: "bi.center_adapt", el: {
items: [ type: "bi.button",
{ text: BI.i18nText("BI-Basic_OK"),
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", close();
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [true]);
el: { }
type: "bi.border", }
cls: "bi-message-title bi-background", }
items: { });
center: { var conf = {
el: { element: $pop,
type: "bi.label", type: "bi.center_adapt",
text: title || BI.i18nText("BI-Basic_Prompt"), items: [
textAlign: "left", {
hgap: 20, type: "bi.border",
height: 50 cls: "bi-message-content bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
}
},
width: 60
}
} }
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
} }
}, },
south: { height: 50
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: { type: "bi.text",
type: "bi.right_vertical_adapt", cls: "bi-message-text",
hgap: 5, tgap: 60,
items: controlItems hgap: 20,
}, lineHeight: 30,
top: 0, whiteSpace: "normal",
left: 20, text: message
right: 20,
bottom: 0
}]
},
height: 60
} }
}, },
width: 400, south: {
height: 300 el: {
} type: "bi.absolute",
] items: [{
}; el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
messageShow = BI.createWidget(conf); },
} height: 60
}; }
}() },
});/** width: 400,
height: 300
}
]
};
messageShow = BI.createWidget(conf);
}
};
}();/**
* GridView * GridView
* *
* Created by GUY on 2016/1/11. * Created by GUY on 2016/1/11.

6
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

304
src/base/foundation/message.js

@ -3,177 +3,175 @@
* 弹出提示消息框用于模拟阻塞操作通过回调函数实现 * 弹出提示消息框用于模拟阻塞操作通过回调函数实现
* @class BI.Msg * @class BI.Msg
*/ */
$.extend(BI, { BI.Msg = function () {
Msg: function () {
var messageShow, $mask, $pop; var messageShow, $mask, $pop;
return { return {
alert: function (title, message, callback) { alert: function (title, message, callback) {
this._show(false, title, message, callback); this._show(false, title, message, callback);
}, },
confirm: function (title, message, callback) { confirm: function (title, message, callback) {
this._show(true, title, message, callback); this._show(true, title, message, callback);
}, },
prompt: function (title, message, value, callback, min_width) { prompt: function (title, message, value, callback, min_width) {
// BI.Msg.prompt(title, message, value, callback, min_width); // BI.Msg.prompt(title, message, value, callback, min_width);
}, },
toast: function (message, options, context) { toast: function (message, options, context) {
options = options || {}; options = options || {};
context = context || $("body"); context = context || $("body");
var level = options.level || "normal"; var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose; var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({ var toast = BI.createWidget({
type: "bi.toast", type: "bi.toast",
cls: "bi-message-animate bi-message-leave", cls: "bi-message-animate bi-message-leave",
level: level, level: level,
autoClose: autoClose, autoClose: autoClose,
text: message text: message
}); });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: context, element: context,
items: [{ items: [{
el: toast, el: toast,
left: "50%", left: "50%",
top: 10 top: 10
}] }]
}); });
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () { autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () { BI.delay(function () {
toast.destroy(); toast.destroy();
}, 1000); }, 1000);
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({ $mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 2, zIndex: BI.zIndex_tip - 2,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
opacity: 0.5 opacity: 0.5
}).appendTo("body"); }).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({ $pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute", position: "absolute",
zIndex: BI.zIndex_tip - 1, zIndex: BI.zIndex_tip - 1,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}).appendTo("body"); }).appendTo("body");
var close = function () { var close = function () {
messageShow.destroy(); messageShow.destroy();
$mask.remove(); $mask.remove();
}; };
var controlItems = []; var controlItems = [];
if (hasCancel === true) { if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
}
controlItems.push({ controlItems.push({
el: { el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () { handler: function () {
close(); close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [true]); callback.apply(null, [false]);
} }
} }
} }
}); });
var conf = { }
element: $pop, controlItems.push({
type: "bi.center_adapt", el: {
items: [ type: "bi.button",
{ text: BI.i18nText("BI-Basic_OK"),
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", close();
items: { if (BI.isFunction(callback)) {
north: { callback.apply(null, [true]);
el: { }
type: "bi.border", }
cls: "bi-message-title bi-background", }
items: { });
center: { var conf = {
el: { element: $pop,
type: "bi.label", type: "bi.center_adapt",
text: title || BI.i18nText("BI-Basic_Prompt"), items: [
textAlign: "left", {
hgap: 20, type: "bi.border",
height: 50 cls: "bi-message-content bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 50
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
}
},
width: 60
}
} }
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
} }
}, },
south: { height: 50
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: { type: "bi.text",
type: "bi.right_vertical_adapt", cls: "bi-message-text",
hgap: 5, tgap: 60,
items: controlItems hgap: 20,
}, lineHeight: 30,
top: 0, whiteSpace: "normal",
left: 20, text: message
right: 20,
bottom: 0
}]
},
height: 60
} }
}, },
width: 400, south: {
height: 300 el: {
} type: "bi.absolute",
] items: [{
}; el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
messageShow = BI.createWidget(conf); },
} height: 60
}; }
}() },
}); width: 400,
height: 300
}
]
};
messageShow = BI.createWidget(conf);
}
};
}();
Loading…
Cancel
Save