Styles for setDir ready to test on device.

This commit is contained in:
mmcw-dev 2017-10-21 22:41:58 -04:00
parent 4f19194222
commit a8b62ea392
1 changed files with 27 additions and 5 deletions

View File

@ -94,6 +94,7 @@
-webkit-appearance: none; -webkit-appearance: none;
background: transparent; background: transparent;
box-shadow: none; box-shadow: none;
outline: none;
margin: 5px 0; margin: 5px 0;
padding: 5px 10px; padding: 5px 10px;
box-sizing: border-box; box-sizing: border-box;
@ -136,8 +137,10 @@
right: 10%; right: 10%;
} }
.label{ .label{
text-align: right; text-align: center;
color: #666; color: #666;
margin-top: 10px;
margin-bottom: 5px;
} }
</style> </style>
</head> </head>
@ -150,8 +153,8 @@
<div class="label">Direction</div> <div class="label">Direction</div>
<span id="bwdLabel">BACKWARD</span> <span id="bwdLabel">BACKWARD</span>
<span id="fwdLabel" class="selected">FORWARD</span> <span id="fwdLabel" class="selected">FORWARD</span>
<label class="switch" onclick="setDir();"> <label class="switch">
<input type="checkbox" id="dir"> <input type="checkbox" id="dir" onclick="setDir();">
<span class="slider round"></span> <span class="slider round"></span>
</label> </label>
</div> </div>
@ -181,6 +184,16 @@ null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"
var setDir; var setDir;
var setExposure; var setExposure;
var setDelay; var setDelay;
var setDirLabel = function (dir) {
'use strict';
if (dir) {
$('#bwdLabel').removeClass();
$('#fwdLabel').addClass('selected');
} else {
$('#fwdLabel').removeClass();
$('#bwdLabel').addClass('selected');
}
};
</script> </script>
<script> <script>
var web = {}; var web = {};
@ -198,8 +211,17 @@ null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"
console.dir(res); console.dir(res);
}; };
web.setDir = function () { web.setDir = function () {
var dir = $('#dir').val(); 'use strict';
console.dir(dir); var dir = !$('#dir').is(':checked');
setDirLabel(dir)
$.ajax({
method : 'POST',
url : '/dir',
body : {
dir : dir
},
success : web.setDirSuccess
})
}; };
web.setDirSuccess = function (res) { web.setDirSuccess = function (res) {
'use strict'; 'use strict';