extracted method

This commit is contained in:
Hauke Klement
2015-03-11 17:30:29 +01:00
parent 344f0edb73
commit ca7679cb2d
3 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,12 @@ Array.prototype.includes = function(element) {
return this.indexOf(element) !== -1;
};
window.CodeOcean = {
refresh: function() {
Turbolinks.visit(window.location.pathname);
}
};
$(function() {
var ANIMATION_DURATION = 500;

View File

@ -97,9 +97,7 @@ $(function() {
return _.reject(files, function(file) {
return file.file_id === active_file.id;
});
}, function() {
Turbolinks.visit(window.location.pathname);
});
}, window.CodeOcean.refresh);
};
var downloadCode = function(event) {

View File

@ -20,8 +20,6 @@ $(function() {
}
});
window.CodeOcean = window.CodeOcean || {};
window.CodeOcean.CHOSEN_OPTIONS = CHOSEN_OPTIONS;
$('select:visible').chosen(CHOSEN_OPTIONS);
});