let time = $localStorage[CONFIG.localStorage.time];
let timeout;
const checkStorage = (_oldTime, _countMilliSeconds = (CONFIG.timeoutSeconds.getInfo * 30)) => {
$timeout.cancel(timeout);
timeout = $timeout(() => {
console.log(_oldTime, $localStorage[CONFIG.localStorage.time]);
if (_oldTime == $localStorage[CONFIG.localStorage.time]) {
$localStorage[CONFIG.localStorage.time] = Math.round(new Date().getTime());
$localStorage.$apply();
getInfo();
} else {
checkStorage($localStorage[CONFIG.localStorage.time]);
}
}, _countMilliSeconds);
};
if (angular.isDefined(time) && (Math.round(new Date().getTime())-time) <= (CONFIG.timeoutSeconds.getInfo*3)) {
checkStorage(time, CONFIG.timeoutSeconds.getInfo*6);
} else {
checkStorage(time, 0);
}
const getInfo = () => {
$localStorage[CONFIG.localStorage.time] = Math.round(new Date().getTime());
$localStorage.$apply();
$timeout(() => {
getInfo();
}, CONFIG.timeoutSeconds.getInfo);
};
'VALUES' =>
array (size=5)
2 =>
array (size=5)
'ID' => int 2
'NAME' => string 'ЛАЙТ (LAN без аккумулятора)' (length=46)
'SORT' => int 100
'XML_ID' => string 'lite' (length=4)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
1 =>
array (size=5)
'ID' => int 1
'NAME' => string 'МОБАЙЛ (LAN, GSM с аккумулятором)' (length=53)
'SORT' => int 100
'XML_ID' => string 'mobile' (length=6)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
3 =>
array (size=5)
'ID' => int 3
'NAME' => string 'СТАНДАРТ (WiFi без аккумулятора)' (length=55)
'SORT' => int 100
'XML_ID' => string 'standart' (length=8)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
4 =>
array (size=5)
'ID' => int 4
'NAME' => string 'УНИВЕРСАЛ (LAN, GSM без аккумулятора)' (length=61)
'SORT' => int 100
'XML_ID' => string 'universal' (length=9)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
0 =>
array (size=6)
'ID' => int 0
'SORT' => int 9223372036854775807
'NA' => boolean true
'NAME' => string '-' (length=1)
'XML_ID' => string '' (length=0)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
'SHOW_MODE' => string 'PICT' (length=4)
'DEFAULT_VALUES' =>
array (size=2)
'PICT' =>
array (size=4)
'ID' => int 0
'SRC' => string '/local/templates/template/components/bitrix/catalog.element/business/images/no_photo.png' (length=88)
'WIDTH' => int 150
'HEIGHT' => int 150
'NAME' => string '-' (length=1)
<option value="?" selected="selected"></option>