extracted method
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -20,8 +20,6 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
window.CodeOcean = window.CodeOcean || {};
|
||||
window.CodeOcean.CHOSEN_OPTIONS = CHOSEN_OPTIONS;
|
||||
|
||||
$('select:visible').chosen(CHOSEN_OPTIONS);
|
||||
});
|
||||
|
Reference in New Issue
Block a user