extracted method
This commit is contained in:
@ -2,6 +2,12 @@ Array.prototype.includes = function(element) {
|
|||||||
return this.indexOf(element) !== -1;
|
return this.indexOf(element) !== -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.CodeOcean = {
|
||||||
|
refresh: function() {
|
||||||
|
Turbolinks.visit(window.location.pathname);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var ANIMATION_DURATION = 500;
|
var ANIMATION_DURATION = 500;
|
||||||
|
|
||||||
|
@ -97,9 +97,7 @@ $(function() {
|
|||||||
return _.reject(files, function(file) {
|
return _.reject(files, function(file) {
|
||||||
return file.file_id === active_file.id;
|
return file.file_id === active_file.id;
|
||||||
});
|
});
|
||||||
}, function() {
|
}, window.CodeOcean.refresh);
|
||||||
Turbolinks.visit(window.location.pathname);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var downloadCode = function(event) {
|
var downloadCode = function(event) {
|
||||||
|
@ -20,8 +20,6 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.CodeOcean = window.CodeOcean || {};
|
|
||||||
window.CodeOcean.CHOSEN_OPTIONS = CHOSEN_OPTIONS;
|
window.CodeOcean.CHOSEN_OPTIONS = CHOSEN_OPTIONS;
|
||||||
|
|
||||||
$('select:visible').chosen(CHOSEN_OPTIONS);
|
$('select:visible').chosen(CHOSEN_OPTIONS);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user