From 8ac476833cb83f80439df3e81473ae8b794ebaf8 Mon Sep 17 00:00:00 2001 From: Roi Ezra Date: Tue, 9 Aug 2016 14:21:30 +0300 Subject: [PATCH] complied sources --- dist/swissSettings.js | 10 ++++++---- dist/swissSettings.min.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/swissSettings.js b/dist/swissSettings.js index 10d0c4e..b64a363 100644 --- a/dist/swissSettings.js +++ b/dist/swissSettings.js @@ -50,7 +50,7 @@ if (this.value === undefined) { this.value = localStorageService.get(this.name); } - if (this.storageDuration) { + if (this.storageDuration && this.storageDuration !== 0) { var setDate = localStorageService.get(this.name + setTimePostFix); if (setDate && moment(setDate).add(this.storageDuration) < moment()) { $log.debug('AbstractField: will clear ' + this.name + ' stored value as duration since ' + @@ -67,9 +67,11 @@ if (!this.validate(value)) { throw 'Invalid value: ' + value; } - localStorageService.set(this.name, value); - if (this.storageDuration) { - localStorageService.set(this.name + setTimePostFix, new Date()); + if (this.storageDuration !== 0) { + localStorageService.set(this.name, value); + if (this.storageDuration) { + localStorageService.set(this.name + setTimePostFix, new Date()); + } } this.value = value; } diff --git a/dist/swissSettings.min.js b/dist/swissSettings.min.js index 453d815..5450137 100644 --- a/dist/swissSettings.min.js +++ b/dist/swissSettings.min.js @@ -1 +1 @@ -!function(){"use strict";angular.module("swissAngularSettings",["LocalStorageModule"])}(),function(){"use strict";function a(a,b){function c(a,b,c,d){if(!a)throw"Name must be defined";this.name=a,this.typeName=b,this.defaultValue=angular.isDefined(c)?c:void 0,this.storageDuration=d,this.value=void 0,angular.isDefined(c)&&j.call(this,c)}function d(){if(void 0===this.value&&(this.value=a.get(this.name)),this.storageDuration){var c=a.get(this.name+l);c&&moment(c).add(this.storageDuration)