fixed zone bugs
This commit is contained in:
parent
c3f20dba3c
commit
ac1e619b06
|
@ -93,7 +93,7 @@ export default class Calendar extends Component {
|
|||
}
|
||||
|
||||
applyOffset(date) {
|
||||
date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||
// date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
|
||||
}
|
||||
|
||||
repaint() {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div class="textField">
|
||||
<div class="leftIcons">
|
||||
<vn-icon-button
|
||||
ng-if="::$ctrl.step"
|
||||
icon="remove"
|
||||
ng-click="$ctrl.remove()"
|
||||
tabindex="-1"
|
||||
|
@ -13,7 +14,7 @@
|
|||
<input
|
||||
class="mdl-textfield__input"
|
||||
type="number"
|
||||
name="{{$ctrl.name}}"
|
||||
name="{{::$ctrl.name}}"
|
||||
ng-model="$ctrl.value"
|
||||
ng-disabled="$ctrl.disabled"
|
||||
ng-readonly="$ctrl.readonly"
|
||||
|
@ -26,14 +27,15 @@
|
|||
<div class="selected underline"></div>
|
||||
<div class="suffix">
|
||||
<vn-icon-button
|
||||
ng-if="::$ctrl.step"
|
||||
icon="add"
|
||||
ng-click="$ctrl.add()"
|
||||
tabindex="-1"
|
||||
translate-attr="{title: 'Add'}">
|
||||
</vn-icon-button>
|
||||
<i class="material-icons"
|
||||
ng-if="$ctrl.hasInfo"
|
||||
vn-tooltip="{{$ctrl.info}}">
|
||||
ng-if="::$ctrl.hasInfo"
|
||||
vn-tooltip="{{::$ctrl.info}}">
|
||||
info_outline
|
||||
</i>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,6 @@ import Textfield from '../textfield/textfield';
|
|||
import './style.scss';
|
||||
|
||||
export default class InputNumber extends Textfield {
|
||||
|
||||
constructor($element, $scope, $attrs, vnTemplate, $transclude) {
|
||||
super($element, $scope, $attrs, vnTemplate, $transclude);
|
||||
|
||||
|
@ -56,30 +55,30 @@ export default class InputNumber extends Textfield {
|
|||
if ((this.validate() !== undefined && !this.validate()) ||
|
||||
(this.max && this.value > this.max) ||
|
||||
(this.min && this.value < this.min) ||
|
||||
(this.step && this.value % this.step != 0)) {
|
||||
(this.step && this.value % this.step != 0))
|
||||
this.$element[0].querySelector('.infix').classList.add('invalid', 'validated');
|
||||
}
|
||||
|
||||
|
||||
if (this.onChange)
|
||||
this.onChange();
|
||||
}
|
||||
|
||||
add() {
|
||||
if (this.step && this.value % this.step != 0) {
|
||||
if (this.step && this.value % this.step != 0)
|
||||
this.value += (this.step - this.value % this.step);
|
||||
} else {
|
||||
else
|
||||
this.value += this.step;
|
||||
}
|
||||
|
||||
|
||||
this.validateValue();
|
||||
}
|
||||
|
||||
remove() {
|
||||
if (this.step && this.value % this.step != 0) {
|
||||
if (this.step && this.value % this.step != 0)
|
||||
this.value -= (this.step + this.value % this.step);
|
||||
} else {
|
||||
else
|
||||
this.value -= this.step;
|
||||
}
|
||||
|
||||
this.validateValue();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,9 @@ class Controller {
|
|||
this.ndMonth = this.$scope.ndMonth;
|
||||
}
|
||||
|
||||
get zone() {
|
||||
// Disabled until implementation
|
||||
// of holidays by node
|
||||
/* get zone() {
|
||||
return this._zone;
|
||||
}
|
||||
|
||||
|
@ -41,7 +43,7 @@ class Controller {
|
|||
|
||||
this.events = this.events.concat(events);
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
get data() {
|
||||
return this._data;
|
||||
|
|
|
@ -51,14 +51,12 @@
|
|||
<vn-input-number vn-one
|
||||
label="Price"
|
||||
field="$ctrl.zone.price"
|
||||
min="0.00"
|
||||
step="0.50">
|
||||
min="0.00">
|
||||
</vn-input-number>
|
||||
<vn-input-number vn-one
|
||||
label="Bonus"
|
||||
field="$ctrl.zone.bonus"
|
||||
min="0.00"
|
||||
step="0.50">
|
||||
min="0.00">
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
|
|
|
@ -23,12 +23,13 @@ class Controller {
|
|||
}
|
||||
|
||||
onSelection(item, isIncluded) {
|
||||
item.isIncluded = isIncluded;
|
||||
const path = '/agency/api/ZoneIncludeds/toggleIsIncluded';
|
||||
const params = {zoneFk: this.zone.id, item};
|
||||
this.$http.post(path, params).then(() => {
|
||||
let node = Object.assign({}, item);
|
||||
node.isIncluded = isIncluded;
|
||||
node.childs = []; // Data too large
|
||||
|
||||
});
|
||||
const path = '/agency/api/ZoneIncludeds/toggleIsIncluded';
|
||||
const params = {zoneFk: this.zone.id, item: node};
|
||||
this.$http.post(path, params);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue