Skip to content

Commit 729afea

Browse files
committed
Added new prop zIndex and method zIndex() to the window component, issue #1995
1 parent af4b381 commit 729afea

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
+ [x] Fixed method `val()` in the select component for multiple select.
44
+ [x] Fixed the movement of the hour hand in the analog clock (thanks to CmPi).
55
+ [x] Added background patterns
6-
+ [x] Added new gradients gradient-cosmic-aurora, gradient-midnight-mist
6+
+ [x] Added new gradients gradient-cosmic-aurora, gradient-midnight-mist
7+
+ [x] Added new icons
8+
+ [x] Added new prop `zIndex` and method `zIndex()` to the `window` component

source/components/window/window.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
maxWidth: 0,
4848
maxHeight: 0,
4949

50+
zIndex: null,
51+
5052
onDragStart: Metro.noop,
5153
onDragStop: Metro.noop,
5254
onDragMove: Metro.noop,
@@ -257,6 +259,10 @@
257259

258260
win = $("<div>").addClass("window");
259261

262+
if (o.zIndex !== null) {
263+
win.css("z-index", o.zIndex);
264+
}
265+
260266
if (o.modal === true) {
261267
win.addClass("modal");
262268
}
@@ -712,6 +718,16 @@
712718
return this;
713719
},
714720

721+
zIndex: function (v) {
722+
if (Metro.utils.isNull(v) === false) {
723+
this.win.css({
724+
zIndex: +v,
725+
});
726+
}
727+
728+
return this.win.style("zIndex");
729+
},
730+
715731
changeAttribute: function (attr, value) {
716732
const changePos = function (a, v) {
717733
const win = this.win;

0 commit comments

Comments
 (0)