mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Circular dependencies json-stringify and wrapper nullcheck
This commit is contained in:
@@ -268,6 +268,7 @@ var List = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
dynamicContentPageJumpTo: function(page) {
|
dynamicContentPageJumpTo: function(page) {
|
||||||
|
if(document.querySelector("#wrapper") == null) return
|
||||||
page = page * List.can_fit;
|
page = page * List.can_fit;
|
||||||
var wrapperChildren = [].slice.call(document.querySelector("#wrapper").children);
|
var wrapperChildren = [].slice.call(document.querySelector("#wrapper").children);
|
||||||
if(page > List.page || page < List.page){
|
if(page > List.page || page < List.page){
|
||||||
@@ -293,6 +294,7 @@ var List = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
dynamicContentPage: function(way) {
|
dynamicContentPage: function(way) {
|
||||||
|
if(document.querySelector("#wrapper") == null) return
|
||||||
var wrapperChildren = [].slice.call(document.querySelector("#wrapper").children);
|
var wrapperChildren = [].slice.call(document.querySelector("#wrapper").children);
|
||||||
if(way == 1 || way == 10) {
|
if(way == 1 || way == 10) {
|
||||||
Helper.css(wrapperChildren.slice(List.page, List.page + List.can_fit), "display", "none");
|
Helper.css(wrapperChildren.slice(List.page, List.page + List.can_fit), "display", "none");
|
||||||
|
|||||||
@@ -170,7 +170,25 @@ if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.locat
|
|||||||
</div>');
|
</div>');
|
||||||
M.Modal.init(document.getElementById("contact"));
|
M.Modal.init(document.getElementById("contact"));
|
||||||
M.Modal.getInstance(document.getElementById("contact")).open();
|
M.Modal.getInstance(document.getElementById("contact")).open();
|
||||||
Helper.setHtml("#error-report-code", JSON.stringify(Helper.logs, undefined, 4));
|
var cache = [];
|
||||||
|
Helper.setHtml("#error-report-code", JSON.stringify(Helper.logs, function(key, value) {
|
||||||
|
if (typeof value === 'object' && value !== null) {
|
||||||
|
if (cache.indexOf(value) !== -1) {
|
||||||
|
// Duplicate reference found
|
||||||
|
try {
|
||||||
|
// If this value does not reference a parent it can be deduped
|
||||||
|
return JSON.parse(JSON.stringify(value));
|
||||||
|
} catch (error) {
|
||||||
|
// discard key if value cannot be deduped
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Store value in our collection
|
||||||
|
cache.push(value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}, 4));
|
||||||
|
cache = null;
|
||||||
//console.error(e.originalEvent.error);
|
//console.error(e.originalEvent.error);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user