Compare commits

..

No commits in common. "81627889e5966d5e2981742fdafcec3f8ba8c582" and "08a8e143dc8b7a6d2e0a34c89d3d9b23d31497f2" have entirely different histories.

3 changed files with 53 additions and 47 deletions

View File

@ -598,9 +598,7 @@ bricks.App = class extends bricks.Layout {
console.log('event=', event); console.log('event=', event);
event.preventDefault(); event.preventDefault();
event.stopPropagation() event.stopPropagation()
var opts = bricks.get_popup_default_options(); this.wins_panel = new bricks.WindowsPanel({})
this.wins_panel = new bricks.WindowsPanel(opts);
this.wins_panel.open();
} }
get_color(){ get_color(){
return getComputedStyle(this.dom_element).color; return getComputedStyle(this.dom_element).color;

View File

@ -605,9 +605,3 @@ hr {
color: #00aaff; color: #00aaff;
background: #f0faff; background: #f0faff;
} }
.mini-window {
width: 50px;
height: 50px;
}

View File

@ -1,7 +1,7 @@
var bricks = window.bricks || {}; var bricks = window.bricks || {};
bricks.get_popup_default_options = function(){ bricks.get_popup_default_options = function(){
ret = { return {
timeout:0, timeout:0,
archor:'cc', archor:'cc',
auto_open:true, auto_open:true,
@ -11,14 +11,6 @@ bricks.get_popup_default_options = function(){
resizable:false, resizable:false,
modal:true modal:true
} }
if (bricks.is_mobile()) {
ret.width = '100%';
ret.height = '100%';
} else {
ret.width = '70%';
ret.height = '70%';
}
return ret
} }
bricks.Popup = class extends bricks.VBox { bricks.Popup = class extends bricks.VBox {
/* /*
@ -372,7 +364,7 @@ bricks.Popup = class extends bricks.VBox {
} }
bricks.get_popupwindow_default_options = function(){ bricks.get_popupwindow_default_options = function(){
ret = { return {
timeout:0, timeout:0,
archor:'cc', archor:'cc',
auto_open:true, auto_open:true,
@ -382,41 +374,63 @@ bricks.get_popupwindow_default_options = function(){
resizable:true, resizable:true,
modal:true modal:true
} }
if (bricks.is_mobile()) {
ret.width = '100%';
ret.height = '100%';
} else {
ret.width = '70%';
ret.height = '70%';
}
return ret
} }
bricks.WindowsPanel = class extends bricks.Popup { bricks.WindowsPanel = class extends bricks.Popup {
open(opts){ constructor(opts){
super.open(); opts.width = "80%";
this.clear_widgets(); opts.auto_open = false;
var dc = new bricks.DynamicColumn({}); opts.auto_dismiss = true;
bricks.app.mwins.forEach(x => { opts.auto_destroy = true;
var w = new bricks.VBox({ opts.height = "80%";
"css": "mini-window card" super(opts);
}); this.content = new bricks.Cols({
dc.add_widget(w); width: "100%",
w.bind('click', this.reopen_windiw.bind(this, x)); height: "100%",
var tw = new bricks.Title6({label:x.title}); record_view: {
var iw = new bricks.Svg({url:x.url, rate:1.5}); widgettype: "VBox",
w.add_widget(iw); options: {
w.add_widget(tw); css: "app-icon"
},
subwidgets: [
{
widgettype: "Text",
options: {
otext: "${title}",
i18n: true,
wrap: true
}
},
{
widgettype: "Svg",
options: {
rate: 2,
url: "${url}"
}
}
]
}
}); });
this.content.bind('record_click', this.del_window.bind(this));
var data = {
total: bricks.app.mwins.length,
rows:[]
};
for (var i=0; i< bricks.app.mwins.length; i++){
data.rows.push({
title: bricks.app.mwins[i].title,
url: bricks.app.mwins[i].url,
pos: i
});
}
this.content.dataHandle(data);
this.add_widget(this.content);
} }
del_window(w){ del_window(event){
var nws = []; var pos = event.params.pos;
var w = bricks.app.mwins[pos]; var w = bricks.app.mwins[pos];
w.open(); w.open();
bricks.app.mwins.forEach(x => { bricks.app.mwins.splice(pos, 1);
if (x != w) nws.push(x);
});
bricks.app.mwins = nws;
this.dismiss(); this.dismiss();
} }
} }