We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit bbd8e11f authored by Nick de Kleijn's avatar Nick de Kleijn

[VM-233] +: isButtonActive function for databind +: set...

[VM-233] +: isButtonActive function for databind +: set isPlaceOrderActionAllowed on start place order event
parent cfb02277
...@@ -152,6 +152,15 @@ define( ...@@ -152,6 +152,15 @@ define(
isActive: function () { isActive: function () {
return true; return true;
}, },
/**
* Returns state of place order button
* @returns {boolean}
*/
isButtonActive: function() {
return this.isActive() && this.getCode() == this.isChecked() && this.isPlaceOrderActionAllowed();
},
/** /**
* @override * @override
*/ */
......
...@@ -280,12 +280,9 @@ ...@@ -280,12 +280,9 @@
<div class="primary"> <div class="primary">
<button class="action primary checkout" <button class="action primary checkout"
type="submit" type="submit"
data-bind=" data-bind="click: placeOrder,
click: placeOrder,
attr: {title: $t('Place Order')}, attr: {title: $t('Place Order')},
enable: (getCode() == isChecked()), enable: isButtonActive()"
css: {disabled: !isPlaceOrderActionAllowed()}
"
disabled> disabled>
<span data-bind="text: $t('Place Order')"></span> <span data-bind="text: $t('Place Order')"></span>
</button> </button>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment