Update localStorageModule.js

Change notifications to be consistent with original code, lowercase.
dev
lucuma 11 years ago
parent 255fafe769
commit 035a10b715

@ -43,7 +43,7 @@ angularLocalStorage.service('localStorageService', [
if (!browserSupportsLocalStorage()) { if (!browserSupportsLocalStorage()) {
$rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED'); $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
if (notify.setItem) { if (notify.setItem) {
$rootScope.$broadcast('LocalStorageModule.notification.setItem', {key: key, newvalue: value, storageType: 'cookie'}); $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'cookie'});
} }
return addToCookies(key, value); return addToCookies(key, value);
} }
@ -54,7 +54,7 @@ angularLocalStorage.service('localStorageService', [
try { try {
localStorage.setItem(prefix+key, value); localStorage.setItem(prefix+key, value);
if (notify.setItem) { if (notify.setItem) {
$rootScope.$broadcast('LocalStorageModule.notification.setItem', {key: key, newvalue: value, storageType: 'localStorage'}); $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'localStorage'});
} }
} catch (e) { } catch (e) {
$rootScope.$broadcast('LocalStorageModule.notification.error',e.message); $rootScope.$broadcast('LocalStorageModule.notification.error',e.message);
@ -82,7 +82,7 @@ angularLocalStorage.service('localStorageService', [
if (!browserSupportsLocalStorage()) { if (!browserSupportsLocalStorage()) {
$rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED'); $rootScope.$broadcast('LocalStorageModule.notification.warning','LOCAL_STORAGE_NOT_SUPPORTED');
if (notify.removeItem) { if (notify.removeItem) {
$rootScope.$broadcast('LocalStorageModule.notification.removeItem', {key: key, storageType: 'cookie'}); $rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: 'cookie'});
} }
return removeFromCookies(key); return removeFromCookies(key);
} }
@ -90,7 +90,7 @@ angularLocalStorage.service('localStorageService', [
try { try {
localStorage.removeItem(prefix+key); localStorage.removeItem(prefix+key);
if (notify.removeItem) { if (notify.removeItem) {
$rootScope.$broadcast('LocalStorageModule.notification.removeItem', {key: key, storageType: 'localStorage'}); $rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: 'localStorage'});
} }
} catch (e) { } catch (e) {
$rootScope.$broadcast('LocalStorageModule.notification.error',e.message); $rootScope.$broadcast('LocalStorageModule.notification.error',e.message);