bugfix
This commit is contained in:
parent
08a8e143dc
commit
78b14f7276
@ -598,7 +598,9 @@ bricks.App = class extends bricks.Layout {
|
|||||||
console.log('event=', event);
|
console.log('event=', event);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.wins_panel = new bricks.WindowsPanel({})
|
var opts = bricks.get_popup_default_options();
|
||||||
|
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;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
var bricks = window.bricks || {};
|
var bricks = window.bricks || {};
|
||||||
|
|
||||||
bricks.get_popup_default_options = function(){
|
bricks.get_popup_default_options = function(){
|
||||||
return {
|
ret = {
|
||||||
timeout:0,
|
timeout:0,
|
||||||
archor:'cc',
|
archor:'cc',
|
||||||
auto_open:true,
|
auto_open:true,
|
||||||
@ -11,6 +11,14 @@ 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 {
|
||||||
/*
|
/*
|
||||||
@ -364,7 +372,7 @@ bricks.Popup = class extends bricks.VBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bricks.get_popupwindow_default_options = function(){
|
bricks.get_popupwindow_default_options = function(){
|
||||||
return {
|
ret = {
|
||||||
timeout:0,
|
timeout:0,
|
||||||
archor:'cc',
|
archor:'cc',
|
||||||
auto_open:true,
|
auto_open:true,
|
||||||
@ -374,63 +382,41 @@ 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 {
|
||||||
constructor(opts){
|
open(opts){
|
||||||
opts.width = "80%";
|
super.open();
|
||||||
opts.auto_open = false;
|
this.clear_widgets();
|
||||||
opts.auto_dismiss = true;
|
var dc = new bricks.DynamicColumn({});
|
||||||
opts.auto_destroy = true;
|
bricks.app.mwins.forEach(x => {
|
||||||
opts.height = "80%";
|
var w = new bricks.VBox({
|
||||||
super(opts);
|
"css": "mini-window card"
|
||||||
this.content = new bricks.Cols({
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
record_view: {
|
|
||||||
widgettype: "VBox",
|
|
||||||
options: {
|
|
||||||
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));
|
dc.add_widget(w);
|
||||||
var data = {
|
w.bind('click', this.reopen_windiw.bind(this, x));
|
||||||
total: bricks.app.mwins.length,
|
var tw = new bricks.Title6({label:x.title});
|
||||||
rows:[]
|
var iw = new bricks.Svg({url:x.url});
|
||||||
};
|
w.add_widget(iw);
|
||||||
for (var i=0; i< bricks.app.mwins.length; i++){
|
w.add_widget(tw);
|
||||||
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(event){
|
del_window(w){
|
||||||
var pos = event.params.pos;
|
var nws = [];
|
||||||
var w = bricks.app.mwins[pos];
|
var w = bricks.app.mwins[pos];
|
||||||
w.open();
|
w.open();
|
||||||
bricks.app.mwins.splice(pos, 1);
|
bricks.app.mwins.forEach(x => {
|
||||||
|
if (x != w) nws.push(x);
|
||||||
|
});
|
||||||
|
bricks.app.mwins = nws;
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user