Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
russll committed Jul 31, 2014
1 parent 8779448 commit d54b4ff
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 37 deletions.
4 changes: 2 additions & 2 deletions index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// @import './src/core/d-core-submenu/index.styl'
@import './src/core/d-core-toolbar/index.styl'

@import './src/paper/d-paper-ripple/index.styl'
@import './src/paper/d-paper-shadow/index.styl'
@import './src/paper/d-paper-button/index.styl'
@import './src/paper/d-paper-checkbox/index.styl'
@import './src/paper/d-paper-dialog/index.styl'
Expand All @@ -26,8 +28,6 @@
@import './src/paper/d-paper-progress/index.styl'
@import './src/paper/d-paper-radio-button/index.styl'
@import './src/paper/d-paper-radio-group/index.styl'
@import './src/paper/d-paper-ripple/index.styl'
@import './src/paper/d-paper-shadow/index.styl'
@import './src/paper/d-paper-slider/index.styl'
@import './src/paper/d-paper-tab/index.styl'
@import './src/paper/d-paper-tabs/index.styl'
Expand Down
2 changes: 1 addition & 1 deletion src/paper/d-paper-button/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
-->

<div as="wrapper" class="d-paper-button{{if raised}} raised-button{{/if}}{{if fab}} fab{{/if}} {{class}}" aria-label="{{label}}" tabindex="{{tabindex}}" tooltip="{{label}}" role="button" on-mousedown="downAction($event)" on-mouseup="upAction($event)" on-focus="focusAction($event)" on-blur="blurAction($event)" on-contextmenu="contextMenuAction($event)" style="z-index: {{z}};{{if width}}width: {{width}};{{/if}}{{if height}}height: {{height}};{{/if}}">
<div as="wrapper" class="d-paper-button{{if raised}} raised-button{{/if}}{{if fab}} fab{{/if}} {{class}}" aria-label="{{label}}" tabindex="{{tabindex}}" tooltip="{{label}}" role="button" on-click="clickAction($event)" on-dblclick="dblClickAction($event)" on-mousedown="downAction($event)" on-mouseup="upAction($event)" on-focus="focusAction($event)" on-blur="blurAction($event)" on-contextmenu="contextMenuAction($event)" style="z-index: {{z}};{{if width}}width: {{width}};{{/if}}{{if height}}height: {{height}};{{/if}}">

{{if raised}}
<div class="shadow-container fit">
Expand Down
32 changes: 20 additions & 12 deletions src/paper/d-paper-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,7 @@ PaperButton.prototype.downAction = function(event) {
} else {
this.model.set('active', true);
}
}

// Pulling up the context menu for an item should focus it; but we need to
// be careful about how we deal with down/up events surrounding context
// menus. The up event typically does not fire until the context menu
// closes: so we focus immediately.
//
// This fires _after_ downAction.
PaperButton.prototype.contextMenuAction = function(e) {
// Note that upAction may fire _again_ on the actual up event.
this.upAction(e);
this.focusAction();
this.emit('mousedown', event);
}

PaperButton.prototype.upAction = function() {
Expand All @@ -188,6 +177,7 @@ PaperButton.prototype.upAction = function() {
if (!this.model.get('isToggle')) {
this.model.set('active', false);
}
this.emit('mouseup', event);
}

PaperButton.prototype.focusAction = function() {
Expand All @@ -201,3 +191,21 @@ PaperButton.prototype.focusAction = function() {
PaperButton.prototype.blurAction = function() {
this.model.set('focused', false);
}
PaperButton.prototype.clickAction = function(event) {
this.emit('click', event);
}
PaperButton.prototype.dblClickAction = function(event) {
this.emit('dblclick', event);
}

// Pulling up the context menu for an item should focus it; but we need to
// be careful about how we deal with down/up events surrounding context
// menus. The up event typically does not fire until the context menu
// closes: so we focus immediately.
//
// This fires _after_ downAction.
PaperButton.prototype.contextMenuAction = function(e) {
// Note that upAction may fire _again_ on the actual up event.
this.upAction(e);
this.focusAction();
}
21 changes: 0 additions & 21 deletions src/paper/d-paper-radio-button/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,27 @@
/* disabled state */
&.disabled
pointer-events none


&.disabled .off-radio
border-color #eaeaea !important


&.disabled .on-radio
background-color #eaeaea !important

.radio-container
position relative
width 16px
height 16px
cursor pointer


.radio-container.labeled
display inline-block
vertical-align middle


.d-paper-ripple
position absolute
top -17px
left -17px
width 50px
height 50px
color #5a5a5a


.d-paper-ripple.checked
color #0f9d58


.off-radio
position absolute
top 0px
Expand All @@ -49,8 +36,6 @@
border-radius 50%
border solid 2px
border-color #5a5a5a


.on-radio
position absolute
top 0
Expand All @@ -63,22 +48,16 @@
transform scale(0)
transition -webkit-transform ease 0.28s
transition transform ease 0.28s


.on-radio.fill
-webkit-transform scale(1.1)
transform scale(1.1)


.radio-label
position relative
display inline-block
vertical-align middle
margin-left 10px
white-space normal
pointer-events none


.radio-label.hidden
display none

Expand Down
2 changes: 1 addition & 1 deletion src/paper/d-paper-ripple/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
width 100%
height 100%
overflow hidden
.canvas
& .canvas
pointer-events none
position absolute
top 0
Expand Down

0 comments on commit d54b4ff

Please sign in to comment.