Merge pull request +6218 from c9/sdk

Improved dialog API
pull/39/head
Harutyun Amirjanyan 2015-02-16 23:42:53 +03:00
commit 82b64cecc5
8 zmienionych plików z 23 dodań i 12 usunięć

Wyświetl plik

@ -83,7 +83,7 @@
"c9.ide.imgeditor": "#08bbc53578",
"c9.ide.immediate": "#e9ba147cc2",
"c9.ide.installer": "#24e7d6f399",
"c9.ide.mount": "#c9d598b254",
"c9.ide.mount": "#32e79866ee",
"c9.ide.navigate": "#1ff8b463aa",
"c9.ide.newresource": "#9a7464cc47",
"c9.ide.openfiles": "#28a4f5af16",

Wyświetl plik

@ -391,6 +391,8 @@ define(function(require, exports, module) {
// }
if (!baseclass) {
delete this.baseclass;
delete this.freezePublicAPI.baseclass;
delete this.freezePublicAPI;
delete this.setAPIKey;
delete this.getEmitter;
@ -401,6 +403,7 @@ define(function(require, exports, module) {
return this;
};
var baseclass;
this.baseclass =
this.freezePublicAPI.baseclass = function(){ baseclass = true; };
function getElement(name, callback) {
@ -611,7 +614,7 @@ define(function(require, exports, module) {
/***** Register and define API *****/
this.freezePublicAPI.baseclass();
this.baseclass();
/**
* Base class for all Plugins of Cloud9. A Cloud9 Plugin is

Wyświetl plik

@ -74,11 +74,14 @@ define(function(require, module, exports) {
var modal = options.modal;
var zindex = options.zindex;
var allowClose = options.allowClose;
var elements = options.elements;
var elements = options.elements || [];
var resizable = options.resizable || false;
var widths = options.widths || {};
var count = 0;
if (custom === undefined)
custom = !(body || heading);
var dialog, buttons, titles;
var loaded;
@ -148,9 +151,14 @@ define(function(require, module, exports) {
buttons = plugin.getElement("buttons");
// Create dynamic UI elements
elements.forEach(function(item) {
createItem(null, null, item);
});
if (elements.length) {
elements.forEach(function(item) {
createItem(null, null, item);
});
}
else {
buttons.parentNode.removeChild(buttons);
}
emit.sticky("draw", {
aml: titles,
@ -175,7 +183,7 @@ define(function(require, module, exports) {
implementation();
// Update UI
if (!custom) {
if (!custom && (heading || body)) {
titles.$int.innerHTML = "<h3 style='margin:0 0 10px 0'>"
+ heading + "</h3><div class='alertMsg'>"
+ body + "</div>";

Wyświetl plik

@ -1591,7 +1591,7 @@
@upload-frame-item-color: #e1e1e1;
// Mount
@mount-container-padding: 18px 10px 12px 10px;
@mount-container-padding: 8px 0px 2px 0px;
@mount-loading-background: rgba(0,0,0,0.5);
@mount-loading-color: #f1f1f1;

Wyświetl plik

@ -1591,7 +1591,7 @@
@upload-frame-item-color: #e1e1e1;
// Mount
@mount-container-padding: 18px 10px 12px 10px;
@mount-container-padding: 8px 0px 2px 0px;
@mount-loading-background: rgba(0,0,0,0.5);
@mount-loading-color: #f1f1f1;

Wyświetl plik

@ -1591,7 +1591,7 @@
@upload-frame-item-color: #333;
// Mount
@mount-container-padding: 20px;
@mount-container-padding: 5px 0 0 0;
@mount-loading-background: rgba(0, 0, 0, 0.17);
@mount-loading-color: #333;

Wyświetl plik

@ -1591,7 +1591,7 @@
@upload-frame-item-color: #e1e1e1;
// Mount
@mount-container-padding: 18px 10px 12px 10px;
@mount-container-padding: 8px 0px 2px 0px;
@mount-loading-background: rgba(0,0,0,0.5);
@mount-loading-color: #f1f1f1;

Wyświetl plik

@ -1591,7 +1591,7 @@
@upload-frame-item-color: #e1e1e1;
// Mount
@mount-container-padding: 18px 10px 12px 10px;
@mount-container-padding: 8px 0px 2px 0px;
@mount-loading-background: rgba(0,0,0,0.5);
@mount-loading-color: #f1f1f1;