/* Hide the button if we're on the project,newproject or importlyaer page
* or if there are no projects yet defined
*/
- if (ctx.numProjects == 0 || ctx.currentUrl.search('newproject|project/\\d/$|importlayer/$') > 0){
+ if (ctx.numProjects === 0 || ctx.currentUrl.search('newproject|project/\\d/$|importlayer/$') > 0){
newBuildButton.hide();
return;
}
newBuildButton.show().removeAttr("disabled");
- _checkProjectBuildable()
+ _checkProjectBuildable();
_setupNewBuildButton();
function _checkProjectBuildable(){
- if (ctx.projectId == undefined)
+ if (ctx.projectId === undefined)
return;
libtoaster.getProjectInfo(ctx.projectInfoUrl, ctx.projectId,
function(data){
- if (data.machine.name == undefined || data.layers.length == 0) {
+ if (data.machine.name === undefined || data.layers.length === 0) {
/* we can't build anything with out a machine and some layers */
$("#new-build-button #targets-form").hide();
$("#new-build-button .alert").show();
/* If we don't have a current project then present the set project
* form.
*/
- if (ctx.projectId == undefined) {
+ if (ctx.projectId === undefined) {
$('#change-project-form').show();
$('#project .icon-pencil').hide();
}
* the value that has been set by selecting a suggestion from the typeahead
*/
newBuildProjectInput.on('input', function(event) {
- if (event.keyCode == 13)
+ if (event.keyCode === 13)
return;
newBuildProjectSaveBtn.attr("disabled", "disabled");
});
newBuildTargetInput.on('input', function() {
- if ($(this).val().length == 0)
+ if ($(this).val().length === 0)
newBuildTargetBuildBtn.attr("disabled", "disabled");
else
newBuildTargetBuildBtn.removeAttr("disabled");
});
newBuildProjectSaveBtn.click(function() {
- ctx.projectId = selectedProject.id
+ ctx.projectId = selectedProject.id;
/* Update the typeahead project_id paramater */
_checkProjectBuildable();
newBuildTargetInput.data('typeahead').options.xhrParams.project_id = ctx.projectId;
$(".new-build").click (function(event) {
event.stopPropagation();
});
- };
-
+ }
}