Change 'type' to 'sr-type'.

This commit is contained in:
Kenshin 2017-01-04 15:51:53 +08:00
parent 3d13dbe298
commit 5c9229a331
3 changed files with 24 additions and 24 deletions

View File

@ -175,12 +175,12 @@ sr-dialog sr-dialog-control:hover {
box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),0 1px 7px 0 rgba(0,0,0,0.12),0 3px 1px -1px rgba(0,0,0,0.2);
}
sr-dialog sr-dialog-control[type="cancel"] {
sr-dialog sr-dialog-control[sr-type="cancel"] {
transition: all .5s ease-in-out .1s;
background-color: #80CBC4;
}
sr-dialog sr-dialog-control[type="cancel"]:hover {
sr-dialog sr-dialog-control[sr-type="cancel"]:hover {
background-color: #B2DFDB;
}
@ -264,7 +264,7 @@ sr-opt-theme:not(:first-child) {
margin-left: 5px;
}
sr-opt-theme[type="active"] {
sr-opt-theme[sr-type="active"] {
border: 1px solid #000;
}
@ -278,21 +278,21 @@ sr-opt-item textarea
color: #9e9e9e;
}
sr-opt-item[type="opacity"] {
sr-opt-item[sr-type="opacity"] {
padding-top: 6px;
}
sr-opt-item[type="opacity"] input[type=range] {
sr-opt-item[sr-type="opacity"] input[type=range] {
-webkit-appearance: none;
width: 100%;
margin: 6px 0;
}
sr-opt-item[type="opacity"] input[type=range]:focus {
sr-opt-item[sr-type="opacity"] input[type=range]:focus {
outline: none;
}
sr-opt-item[type="opacity"] input[type=range]::-webkit-slider-runnable-track {
sr-opt-item[sr-type="opacity"] input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 1px;
cursor: pointer;
@ -302,11 +302,11 @@ sr-opt-item[type="opacity"] input[type=range]::-webkit-slider-runnable-track {
transition: all 0.3s;
}
sr-opt-item[type="opacity"] input[type=range]::-webkit-slider-runnable-track:hover {
sr-opt-item[sr-type="opacity"] input[type=range]::-webkit-slider-runnable-track:hover {
background: #00897B;
}
sr-opt-item[type="opacity"] input[type=range]::-webkit-slider-thumb {
sr-opt-item[sr-type="opacity"] input[type=range]::-webkit-slider-thumb {
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0), 0px 0px 1px rgba(13, 13, 13, 0);
border: 1px solid rgba(0, 0, 0, 0);
height: 15px;
@ -319,11 +319,11 @@ sr-opt-item[type="opacity"] input[type=range]::-webkit-slider-thumb {
transition: all 0.3s;
}
sr-opt-item[type="opacity"] input[type=range]:focus::-webkit-slider-thumb {
sr-opt-item[sr-type="opacity"] input[type=range]:focus::-webkit-slider-thumb {
background: #00897B;
}
sr-opt-item[type="opacity"] input[type=range]:focus::-webkit-slider-runnable-track {
sr-opt-item[sr-type="opacity"] input[type=range]:focus::-webkit-slider-runnable-track {
background: #00897B;
}
@ -341,7 +341,7 @@ sr-opt-item input[type="text"] {
transition: all 0.3s;
}
sr-opt-item[type="shortcuts"] input {
sr-opt-item[sr-type="shortcuts"] input {
text-transform: lowercase;
}
@ -350,7 +350,7 @@ sr-opt-item input[type="text"]:focus {
box-shadow: 0 1px 0 0 #00897B;
}
sr-opt-item[type="exclude"] textarea {
sr-opt-item[sr-type="exclude"] textarea {
display: block;
width: 100%;
min-height: 100px;
@ -364,7 +364,7 @@ sr-opt-item[type="exclude"] textarea {
transition: all 0.3s;
}
sr-opt-item[type="exclude"] textarea:focus {
sr-opt-item[sr-type="exclude"] textarea:focus {
border-bottom: 1px solid #00897B;
box-shadow: 0 1px 0 0 #00897B;
}

View File

@ -40,10 +40,10 @@ export default class Dialog extends React.Component {
<Option option={ storage.current } />
</sr-dialog-conent>
<sr-dialog-footer>
<sr-dialog-control href="javascript:void(0);" type="submit" onClick={ () => this.save() }>
<sr-dialog-control href="javascript:void(0);" sr-type="submit" onClick={ () => this.save() }>
确认
</sr-dialog-control>
<sr-dialog-control href="javascript:void(0);" type="cancel" onClick={ () => this.close() }>
<sr-dialog-control href="javascript:void(0);" sr-type="cancel" onClick={ () => this.close() }>
取消
</sr-dialog-control>
</sr-dialog-footer>

View File

@ -24,7 +24,7 @@ export default class FocusOpt extends React.Component {
$target = $(target),
$parent = $target.parent(),
activestyl = "active",
$active = $parent.find( 'sr-opt-theme[type="active"]' ),
$active = $parent.find( 'sr-opt-theme[sr-type="active"]' ),
bgcolor = $target.css( bgcolorstyl ),
color = getColor( bgcolor ),
opacity = getOpacity( $( bgcls ).css( bgcolorstyl ) ),
@ -35,8 +35,8 @@ export default class FocusOpt extends React.Component {
// update active
if ( $active ) {
$active.removeAttr( "type" );
$target.attr( "type", activestyl );
$active.removeAttr( "sr-type" );
$target.attr( "sr-type", activestyl );
}
this.props.option.bgcolor = newval;
console.log( "this.props.option.bgcolor = ", this.props.option.bgcolor )
@ -108,7 +108,7 @@ export default class FocusOpt extends React.Component {
</sr-opt-gp>
<sr-opt-gp>
<sr-opt-label>透明度</sr-opt-label>
<sr-opt-item type="opacity">
<sr-opt-item sr-type="opacity">
<input ref="opacity"
type="range" min="50" max="95" step="5"
onChange={ ()=> this.changeOpacity() }
@ -117,19 +117,19 @@ export default class FocusOpt extends React.Component {
</sr-opt-gp>
<sr-opt-gp>
<sr-opt-label>快捷键</sr-opt-label>
<sr-opt-item type="shortcuts">
<sr-opt-item sr-type="shortcuts">
<input ref="shortcuts" type="text" onKeyDown={ ()=> this.changeShortcuts() } onChange={ ()=>this.changeShortcuts() } />
</sr-opt-item>
</sr-opt-gp>
<sr-opt-gp>
<sr-opt-label>隐藏列表</sr-opt-label>
<sr-opt-item type="exclude">
<sr-opt-item sr-type="exclude">
<textarea ref="exclude" placeholder="每行一个,例如:<div class='xxxx'></div>" onChange={ ()=> this.changExclude() }></textarea>
</sr-opt-item>
</sr-opt-gp>
<sr-opt-gp>
<sr-opt-label>高亮区域</sr-opt-label>
<sr-opt-item type="include">
<sr-opt-item sr-type="include">
<input ref="include" type="text" placeholder="默认为空,自动选择高亮区域。" onChange={ ()=>this.changeInclude() } />
</sr-opt-item>
</sr-opt-gp>
@ -277,7 +277,7 @@ function setBgThemeStyle( bgcolor ) {
const $target = $($themes[i]),
color = getColor( $target.css( "background-color" ));
if ( newcolor === color ) {
$target.attr( "type", "active" );
$target.attr( "sr-type", "active" );
}
}
}