guy 6 years ago
parent
commit
9641b44ff4
  1. 4
      demo/js/config/core.js
  2. 68
      demo/js/core/popup/demo.layer.js
  3. 47
      demo/js/core/popup/demo.popover.js
  4. 8
      dist/bundle.js
  5. 2
      dist/bundle.min.js
  6. 8
      dist/core.js
  7. 118
      dist/demo.js
  8. 8
      dist/fineui.js
  9. 2
      dist/fineui.min.js
  10. 8
      src/core/controller/controller.layer.js

4
demo/js/config/core.js

@ -160,6 +160,10 @@ Demo.CORE_CONFIG = [{
pId: 102,
id: 10202,
text: "弹出层"
}, {
pId: 10202,
text: "layer",
value: "demo.layer"
}, {
pId: 10202,
text: "bi.popover",

68
demo/js/core/popup/demo.layer.js

@ -0,0 +1,68 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this, id1 = BI.UUID(), id2 = BI.UUID();
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.button",
text: "create形式创建layer, 遮住当前面板, 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.create(id1, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.hide(id1);
}
}]
});
BI.Layers.show(id1);
}
}, {
type: "bi.button",
text: "make形式创建layer,可以指定放到哪个面板内,这里指定当前面板(默认放在body下撑满), 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.make(id2, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.remove(id2);
}
}]
});
BI.Layers.show(id2);
}
}]
};
}
});
BI.shortcut("demo.layer", Demo.Func);

47
demo/js/core/popup/demo.popover.js

@ -8,28 +8,31 @@ Demo.Func = BI.inherit(BI.Widget, {
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.text_button",
text: "点击弹出Popover",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
}]
};
}
});

8
dist/bundle.js vendored

@ -26629,16 +26629,16 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
layout.element.on("__resize__", function () {
w.is(":visible") &&
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
});
}

2
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

8
dist/core.js vendored

@ -26629,16 +26629,16 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
layout.element.on("__resize__", function () {
w.is(":visible") &&
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
});
}

118
dist/demo.js vendored

@ -5483,6 +5483,10 @@ Demo.COMPONENT_CONFIG = [{
pId: 102,
id: 10202,
text: "弹出层"
}, {
pId: 10202,
text: "layer",
value: "demo.layer"
}, {
pId: 10202,
text: "bi.popover",
@ -8461,6 +8465,73 @@ Demo.VtapeLayout = BI.inherit(BI.Widget, {
BI.shortcut("demo.vtape", Demo.VtapeLayout);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this, id1 = BI.UUID(), id2 = BI.UUID();
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.button",
text: "create形式创建layer, 遮住当前面板, 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.create(id1, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.hide(id1);
}
}]
});
BI.Layers.show(id1);
}
}, {
type: "bi.button",
text: "make形式创建layer,可以指定放到哪个面板内,这里指定当前面板(默认放在body下撑满), 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.make(id2, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.remove(id2);
}
}]
});
BI.Layers.show(id2);
}
}]
};
}
});
BI.shortcut("demo.layer", Demo.Func);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
@ -8468,28 +8539,31 @@ Demo.Func = BI.inherit(BI.Widget, {
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.text_button",
text: "点击弹出Popover",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
}]
};
}
});

8
dist/fineui.js vendored

@ -26872,16 +26872,16 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
layout.element.on("__resize__", function () {
w.is(":visible") &&
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
});
}

2
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

8
src/core/controller/controller.layer.js

@ -83,16 +83,16 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
layout.element.on("__resize__", function () {
w.is(":visible") &&
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.bottom || 0)) || ""
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
});
}

Loading…
Cancel
Save