-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steve Orvell
committed
May 1, 2012
1 parent
9ac8bc3
commit 45421ba
Showing
4 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
enyo.kind({ | ||
name: "onyx.Scrim", | ||
showing: false, | ||
classes: "onyx-scrim enyo-fit", | ||
floating: false, | ||
//*@ protected | ||
create: function() { | ||
this.inherited(arguments); | ||
if (this.floating) { | ||
this.setParent(enyo.floatingLayer); | ||
} | ||
}, | ||
showingChanged: function() { | ||
// auto render when shown. | ||
if (this.floating && this.showing && !this.hasNode()) { | ||
this.render(); | ||
} | ||
this.inherited(arguments); | ||
//this.addRemoveClass(this.showingClassName, this.showing); | ||
}, | ||
//* @protected | ||
make: function() { | ||
return this; | ||
} | ||
}); | ||
|
||
//* @protected | ||
// | ||
// Scrim singleton exposing a subset of Scrim API. | ||
// is replaced with a proper enyo.Scrim instance. | ||
// | ||
enyo.kind({ | ||
name: "onyx.scrimSingleton", | ||
kind: null, | ||
constructor: function(inName, inProps) { | ||
this.instanceName = inName; | ||
enyo.setObject(this.instanceName, this); | ||
this.props = inProps || {}; | ||
}, | ||
make: function() { | ||
var s = new onyx.Scrim(this.props); | ||
enyo.setObject(this.instanceName, s); | ||
return s; | ||
}, | ||
show: function() { | ||
var s = this.make(); | ||
s.show(); | ||
} | ||
}); | ||
|
||
new onyx.scrimSingleton("onyx.scrim", {floating: true, classes: "onyx-scrim-translucent"}); | ||
new onyx.scrimSingleton("onyx.scrimTransparent", {floating: true, classes: "onyx-scrim-transparent"}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.onyx-scrim { | ||
z-index: 1; | ||
/* | ||
note: by using pointer-events we allow tapping on scrim | ||
while it is fading out; however, this requires any showing classes | ||
to set pointer events to auto or scrim will not function as expected. | ||
*/ | ||
pointer-events: none; | ||
} | ||
|
||
.onyx-scrim.onyx-scrim-translucent{ | ||
pointer-events: auto; | ||
background: rgba(0, 0, 0, 0.65); | ||
} | ||
|
||
.onyx-scrim.onyx-scrim-transparent { | ||
pointer-events: auto; | ||
background: transparent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters