Skip to content

Commit

Permalink
Disable fields that don't make sense on decals
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Prest committed Aug 5, 2015
1 parent 0145588 commit 362b1bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions kb.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
data-hint="Swap the text and keycap colors.">
<button class="btn btn-default"
ng-click="swapColors()"
ng-disabled="selectedKeys.length<1" >
ng-disabled="selectedKeys.length<1 || multi.decal" >
<i class="fa fa-random"></i>
</button>
</div>
Expand All @@ -357,7 +357,7 @@
ng-model="multi.color"
ng-change="updateMulti('color')"
ng-blur="validateMulti('color')"
ng-disabled="selectedKeys.length<1"
ng-disabled="selectedKeys.length<1 || multi.decal"
hint-text="Specify the color to use for the background of the selected keycaps."
ui-on-Drop="dropSwatch($data,$event,false)" drop-channel="dragColor"></kbd-color-picker>
<div class="form-group form-group-sm color-name">{{colorName(multi.color)}}</div>
Expand All @@ -376,14 +376,14 @@
<kbd-multi-numbox field="width2" size="6" min="0.5" max="18" step='{{sizeStep}}' kbd-disable="multi.decal"></kbd-multi-numbox>
</div>

<!-- Swap Colors Button -->
<!-- Swap Sizes Button -->
<div>
<div id="swap-sizes"
class="hint--top hint--rounded"
data-hint="Swap the primary &amp; secondary sizes (affects legend positioning on oddly shaped keys).">
<button class="btn btn-default"
ng-click="swapSizes()"
ng-disabled="selectedKeys.length<1 || (multi.width == multi.width2 && multi.height == multi.height2)" >
ng-disabled="selectedKeys.length<1 || (multi.width == multi.width2 && multi.height == multi.height2) || multi.decal" >
<i class="fa fa-random"></i>
</button>
</div>
Expand Down Expand Up @@ -456,7 +456,7 @@
ng-model="multi.profile"
ng-change="updateMulti('profile')"
ng-blur="validateMulti('profile')"
ng-disabled="selectedKeys.length<1">
ng-disabled="selectedKeys.length<1 || multi.decal">
</div>
</div>
</div>
Expand All @@ -467,9 +467,9 @@
<label class="control-label col-md-3 col-lg-3 text-nowrap">Misc:</label>
<div class="col-md-9 col-lg-9">
<div class="form-inline">
<kbd-multi-check field="ghost" hint-text="Specify whether the selected keys should be rendered slightly transparently; this is useful to draw attention to the other, non-ghosted keycaps.">Ghosted</kbd-multi-check>
<kbd-multi-check field="stepped" hint-text="Specify whether the selected keys are 'stepped', i.e., part of the key is at a lower height than the rest. The secondary 'width' indicates the width of the stepped part.">Stepped</kbd-multi-check>
<kbd-multi-check field="nub" hint-text="Specifies that the selected keys are 'homing' keys, which help the user find the home-row by touch alone.">Homing</kbd-multi-check>
<kbd-multi-check field="ghost" kbd-disable="multi.decal" hint-text="Specify whether the selected keys should be rendered slightly transparently; this is useful to draw attention to the other, non-ghosted keycaps.">Ghosted</kbd-multi-check>
<kbd-multi-check field="stepped" kbd-disable="multi.decal" hint-text="Specify whether the selected keys are 'stepped', i.e., part of the key is at a lower height than the rest. The secondary 'width' indicates the width of the stepped part.">Stepped</kbd-multi-check>
<kbd-multi-check field="nub" kbd-disable="multi.decal" hint-text="Specifies that the selected keys are 'homing' keys, which help the user find the home-row by touch alone.">Homing</kbd-multi-check>
<kbd-multi-check field="decal" hint-text="Specifies that the selected keys are to be treated as 'decals', i.e., purely decorative additions to the layout.">Decal</kbd-multi-check>
</div>
</div>
Expand Down Expand Up @@ -906,7 +906,7 @@ <h4 class="modal-title">{{params.starred ? 'Starred Layouts' : 'Saved Layouts'}}
ng-model="$parent.multi[field]"
ng-change="$parent.updateMulti(field)"
ng-blur="$parent.validateMulti(field)"
ng-disabled="$parent.selectedKeys.length<1">
ng-disabled="$parent.selectedKeys.length<1 || kbdDisable">
<span ng-transclude></span>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@
return { templateUrl: "labelEditor.html", restrict: "E", scope: { hintText: "@", labelIndex: "=" } };
});
kbApp.directive('kbdMultiCheck', function() {
return { templateUrl: "multiCheck.html", restrict: "E", scope: { hintText: "@", field: "@" }, transclude: true };
return { templateUrl: "multiCheck.html", restrict: "E", scope: { hintText: "@", field: "@", kbdDisable: "=" }, transclude: true };
});
kbApp.directive('kbdMultiNumbox', function() {
return { templateUrl: "multiNumbox.html", restrict: "E", scope: { field: "@", size:"@", min:"@", max:"@", step:"@", kbdDisable: "=" } };
Expand Down

0 comments on commit 362b1bb

Please sign in to comment.