Browse Source

BI-34288 alert用popover实现

es6
windy 6 years ago
parent
commit
2a683d7427
  1. 157
      dist/base.js
  2. 163
      dist/bundle.ie.js
  3. 56
      dist/bundle.ie.min.js
  4. 163
      dist/bundle.js
  5. 60
      dist/bundle.min.js
  6. 6
      dist/core.js
  7. 163
      dist/fineui.ie.js
  8. 56
      dist/fineui.ie.min.js
  9. 163
      dist/fineui.js
  10. 60
      dist/fineui.min.js
  11. 163
      dist/fineui_without_jquery_polyfill.js
  12. 2
      dist/utils.min.js
  13. 157
      src/base/foundation/message.js

157
dist/base.js vendored

@ -5181,132 +5181,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

163
dist/bundle.ie.js vendored

@ -31283,15 +31283,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {
@ -40311,132 +40309,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

56
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

163
dist/bundle.js vendored

@ -31283,15 +31283,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {
@ -40715,132 +40713,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

60
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

6
dist/core.js vendored

@ -31283,15 +31283,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {

163
dist/fineui.ie.js vendored

@ -31525,15 +31525,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {
@ -40553,132 +40551,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

56
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

163
dist/fineui.js vendored

@ -31525,15 +31525,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {
@ -40957,132 +40955,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

60
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

163
dist/fineui_without_jquery_polyfill.js vendored

@ -20294,15 +20294,13 @@ BI.TableCenterAdaptLayout = BI.inherit(BI.Layout, {
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"}); w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({ td = BI.createWidget({
type: "bi.default", type: "bi.default",
attributes: { width: width,
width: width
},
items: [w] items: [w]
}); });
this.addWidget(this._getChildName(i), td); this.addWidget(this._getChildName(i), td);
} else { } else {
td = this.getWidgetByName(this._getChildName(i)); td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width); td.element.width(width);
} }
td.element.css({"max-width": o.columnSize[i]}); td.element.css({"max-width": o.columnSize[i]});
if (i === 0) { if (i === 0) {
@ -28624,132 +28622,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}();/** }();/**

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

157
src/base/foundation/message.js

@ -49,132 +49,57 @@ BI.Msg = function () {
}, 5000); }, 5000);
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({ var name = BI.UUID();
position: "absolute", BI.Popovers.create(name, {
zIndex: BI.zIndex_tip - 2, type: "bi.bar_popover",
top: 0, header: title,
left: 0, body: {
right: 0, type: "bi.center_adapt",
bottom: 0, items: [{
opacity: 0.5 type: "bi.label",
}).appendTo("body"); text: message
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({ }]
position: "absolute", },
zIndex: BI.zIndex_tip - 1, footer: hasCancel ? {
top: 0, type: "bi.right_vertical_adapt",
left: 0, lgap: 10,
right: 0, items: [{
bottom: 0
}).appendTo("body");
var close = function () {
messageShow.destroy();
$mask.remove();
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button", type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore", level: "ignore",
handler: function () { handler: function () {
close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
callback.apply(null, [false]); callback.apply(null, [false]);
} }
BI.Popovers.remove(name);
} }
} }, {
}); type: "bi.button",
} text: BI.i18nText("BI-Basic_Sure"),
controlItems.push({ handler: function () {
el: { if (BI.isFunction(callback)) {
type: "bi.button", callback.apply(null, [true]);
text: BI.i18nText("BI-Basic_OK"), }
handler: function () { BI.Popovers.remove(name);
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
} }
} }]
} } : {
}); type: "bi.right_vertical_adapt",
var conf = { lgap: 10,
element: $pop, items: [{
type: "bi.center_adapt", type: "bi.button",
items: [ text: BI.i18nText("BI-Basic_Cancel"),
{ level: "ignore",
type: "bi.border", handler: function () {
cls: "bi-message-content bi-card", if (BI.isFunction(callback)) {
items: { callback.apply(null, [false]);
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();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 50
},
center: {
el: {
type: "bi.text",
cls: "bi-message-text",
tgap: 60,
hgap: 20,
lineHeight: 30,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
hgap: 5,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 60
} }
}, BI.Popovers.remove(name);
width: 400, }
height: 300 }]
} },
] size: "small"
}; }).open(name);
messageShow = BI.createWidget(conf);
} }
}; };
}(); }();
Loading…
Cancel
Save