diff --git a/src/js/anot-touch.js b/src/js/anot-touch.js index 8e67a52..dca7a90 100644 --- a/src/js/anot-touch.js +++ b/src/js/anot-touch.js @@ -3838,8 +3838,20 @@ const _Anot = (function() { if (props.hasOwnProperty(':disabled')) { var disabledKey = props[':disabled'] + var disabledKeyReverse = false + if (disabledKey.indexOf('!') === 0) { + disabledKey = disabledKey.slice(1) + disabledKeyReverse = true + } state.disabled = parseVmValue(parentVm, disabledKey) + if (disabledKeyReverse) { + state.disabled = !state.disabled + } + parentVm.$watch(disabledKey, function(val) { + if (disabledKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!disabled', val) }) @@ -3847,8 +3859,19 @@ const _Anot = (function() { } if (props.hasOwnProperty(':loading')) { var loadingKey = props[':loading'] + var loadingKeyReverse = false + if (loadingKey.indexOf('!') === 0) { + loadingKey = loadingKey.slice(1) + loadingKeyReverse = true + } state.loading = parseVmValue(parentVm, loadingKey) + if (loadingKeyReverse) { + state.loading = !state.loading + } parentVm.$watch(loadingKey, function(val) { + if (loadingKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!loading', val) }) delete props[':loading'] diff --git a/src/js/anot-touch.shim.js b/src/js/anot-touch.shim.js index a5634a3..8695473 100644 --- a/src/js/anot-touch.shim.js +++ b/src/js/anot-touch.shim.js @@ -3853,8 +3853,20 @@ if (props.hasOwnProperty(':disabled')) { var disabledKey = props[':disabled'] + var disabledKeyReverse = false + if (disabledKey.indexOf('!') === 0) { + disabledKey = disabledKey.slice(1) + disabledKeyReverse = true + } state.disabled = parseVmValue(parentVm, disabledKey) + if (disabledKeyReverse) { + state.disabled = !state.disabled + } + parentVm.$watch(disabledKey, function(val) { + if (disabledKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!disabled', val) }) @@ -3862,8 +3874,19 @@ } if (props.hasOwnProperty(':loading')) { var loadingKey = props[':loading'] + var loadingKeyReverse = false + if (loadingKey.indexOf('!') === 0) { + loadingKey = loadingKey.slice(1) + loadingKeyReverse = true + } state.loading = parseVmValue(parentVm, loadingKey) + if (loadingKeyReverse) { + state.loading = !state.loading + } parentVm.$watch(loadingKey, function(val) { + if (loadingKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!loading', val) }) delete props[':loading'] diff --git a/src/js/anot.js b/src/js/anot.js index ac5b11e..1d45c2d 100644 --- a/src/js/anot.js +++ b/src/js/anot.js @@ -3838,8 +3838,20 @@ const _Anot = (function() { if (props.hasOwnProperty(':disabled')) { var disabledKey = props[':disabled'] + var disabledKeyReverse = false + if (disabledKey.indexOf('!') === 0) { + disabledKey = disabledKey.slice(1) + disabledKeyReverse = true + } state.disabled = parseVmValue(parentVm, disabledKey) + if (disabledKeyReverse) { + state.disabled = !state.disabled + } + parentVm.$watch(disabledKey, function(val) { + if (disabledKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!disabled', val) }) @@ -3847,8 +3859,19 @@ const _Anot = (function() { } if (props.hasOwnProperty(':loading')) { var loadingKey = props[':loading'] + var loadingKeyReverse = false + if (loadingKey.indexOf('!') === 0) { + loadingKey = loadingKey.slice(1) + loadingKeyReverse = true + } state.loading = parseVmValue(parentVm, loadingKey) + if (loadingKeyReverse) { + state.loading = !state.loading + } parentVm.$watch(loadingKey, function(val) { + if (loadingKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!loading', val) }) delete props[':loading'] diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index f081268..592e22d 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -3853,8 +3853,20 @@ if (props.hasOwnProperty(':disabled')) { var disabledKey = props[':disabled'] + var disabledKeyReverse = false + if (disabledKey.indexOf('!') === 0) { + disabledKey = disabledKey.slice(1) + disabledKeyReverse = true + } state.disabled = parseVmValue(parentVm, disabledKey) + if (disabledKeyReverse) { + state.disabled = !state.disabled + } + parentVm.$watch(disabledKey, function(val) { + if (disabledKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!disabled', val) }) @@ -3862,8 +3874,19 @@ } if (props.hasOwnProperty(':loading')) { var loadingKey = props[':loading'] + var loadingKeyReverse = false + if (loadingKey.indexOf('!') === 0) { + loadingKey = loadingKey.slice(1) + loadingKeyReverse = true + } state.loading = parseVmValue(parentVm, loadingKey) + if (loadingKeyReverse) { + state.loading = !state.loading + } parentVm.$watch(loadingKey, function(val) { + if (loadingKeyReverse) { + val = !val + } parentVm.$fire('component!' + $id + '!loading', val) }) delete props[':loading'] diff --git a/src/js/form/style.scss b/src/js/form/style.scss index c53dc7d..46aa2c2 100644 --- a/src/js/form/style.scss +++ b/src/js/form/style.scss @@ -222,7 +222,7 @@ &.icon-left {padding-left:30px;} &.icon-right {padding-right:30px;} - &__holder {visibility:hidden;position:absolute;bottom:0;left:0;width:100%;height:30px;color: nth($cp, 3);@include ts(bottom, .2s); + &__holder {visibility:hidden;position:absolute;bottom:0;left:0;width:100%;height:30px;padding:0 5px;color: nth($cp, 3);@include ts(bottom, .2s); &.visible {visibility:visible;} }