Skip to content
Snippets Groups Projects
Commit 5516193b authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '519-fehler-im-container' into 'development'

Einen weiteren Fehler behoben

Closes #519

See merge request !911
parents ea3a4422 0c7187b4
No related branches found
No related tags found
2 merge requests!912Development,!911Einen weiteren Fehler behoben
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
function Results(sort){ function Results(sort){
if(!localStorage) return; if(!localStorage) return;
this.prefix = "result_"; this.prefix = "result_";
this.sort = sort;
this.results = []; this.results = [];
this.updateResults(); this.updateResults();
this.length = this.results.length; this.length = this.results.length;
this.sortResults(sort); this.sortResults();
} }
Results.prototype.sortResults = function(sortType){ Results.prototype.sortResults = function(){
if(sortType === undefined) sortType = "chronological"; if(this.sort === undefined) this.sort = "chronological";
var sortType = this.sort;
switch(sortType){ switch(sortType){
case "chronological": case "chronological":
this.results.sort(function(a,b){ this.results.sort(function(a,b){
...@@ -63,7 +65,8 @@ Results.prototype.deleteResults = function(){ ...@@ -63,7 +65,8 @@ Results.prototype.deleteResults = function(){
}); });
} }
Results.prototype.updateResultPageInterface = function(sortType){ Results.prototype.updateResultPageInterface = function(){
var sortType = this.sort;
if(this.results.length === 0){ if(this.results.length === 0){
$("#savedFokiTabSelector, #savedFoki").remove(); $("#savedFokiTabSelector, #savedFoki").remove();
$($("#foki > li[data-loaded=1]").get(0)).find(">a").tab("show"); $($("#foki > li[data-loaded=1]").get(0)).find(">a").tab("show");
...@@ -96,7 +99,8 @@ Results.prototype.updateResultPageInterface = function(sortType){ ...@@ -96,7 +99,8 @@ Results.prototype.updateResultPageInterface = function(sortType){
this.addToContainer(tabPanel, sortType); this.addToContainer(tabPanel, sortType);
} }
Results.prototype.addToContainer = function(container, sortType){ Results.prototype.addToContainer = function(container){
var sortType = this.sort;
$.each(this.results, function(index, result){ $.each(this.results, function(index, result){
$(container).append(result.toHtml()); $(container).append(result.toHtml());
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment