Commit 4028f632 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

[ci skip] eslint-fix

parent ecd5d340
......@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
}
})
.on('input', function(e) {
var val = e.currentTarget.value || 'new-branch'
var val = e.currentTarget.value || 'new-branch';
val = val.split(' ').join('-') // replaces space with dash
.replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() //replace non alphanumeric
.replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() // replace non alphanumeric
.replace(/(-)\1+/g, '-'); // replace repeated dashes
_this.cb(_this.options.fieldName, val, {}, true);
_this.input.closest('.dropdown')
......@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput.prototype.onInput = function(cb) {
this.cb = cb;
}
};
return GitLabDropdownInput;
})();
......@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
});
}
}
if(this.noFilterInput.length) {
if (this.noFilterInput.length) {
this.plainInput = new GitLabDropdownInput(this.noFilterInput, this.options);
this.plainInput.onInput(this.addInput.bind(this))
this.plainInput.onInput(this.addInput.bind(this));
}
// Init filterable
if (this.options.filterable) {
......@@ -798,7 +798,7 @@ GitLabDropdown = (function() {
GitLabDropdown.prototype.addInput = function(fieldName, value, selectedObject, single) {
var $input;
// Create hidden input for form
if(single){
if (single) {
$('input[name="' + fieldName + '"]').remove();
}
......
......@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
var shouldVisit = typeof $visit === 'undefined' ? true : $visit;
var action = $form.attr('action');
var divider = action.indexOf('?') === -1 ? '?' : '&';
if(shouldVisit){
if (shouldVisit) {
gl.utils.visitUrl(action + '' + divider + '' + $form.serialize());
}
}
}
});
......
......@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue';
import RepoEditor from './repo_editor.vue';
import monacoLoader from './monaco_loader';
import RepoMixin from './repo_mixin';
import PopupDialog from '../vue_shared/components/popup_dialog.vue'
import PopupDialog from '../vue_shared/components/popup_dialog.vue';
Vue.use(Translate);
......@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
window.onbeforeunload = function (e) {
const hasChanged = Store.openedFiles
.some(file => file.changed);
if(!hasChanged) return;
if (!hasChanged) return;
e = e || window.event;
if (e) {
e.returnValue = 'Are you sure you want to lose unsaved changes?';
......@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
function initRepo() {
const repo = document.getElementById('repo');
Store.service = Service;
Store.service.url = repo.dataset.url;
Store.service.refsUrl = repo.dataset.refsUrl;
......@@ -107,8 +106,8 @@ function initRepo() {
dialogSubmitted(status) {
this.dialog.open = false;
this.dialog.status = status;
}
}
},
},
});
const editButton = document.getElementById('editable-mode');
......
......@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
computed: {
pngBlobWithDataURI() {
if(this.binaryTypes.png){
if (this.binaryTypes.png) {
return `data:image/png;base64,${this.blobRaw}`;
}
return '';
},
svgBlobWithDataURI() {
if(this.binaryTypes.svg){
if (this.binaryTypes.svg) {
return `data:image/svg+xml;utf8,${this.blobRaw}`;
}
return '';
......@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
},
getBinaryType() {
if(this.binaryTypes.hasOwnProperty(this.activeFile.extension)) {
if (this.binaryTypes.hasOwnProperty(this.activeFile.extension)) {
return this.activeFile.extension;
}
return 'unknown';
}
},
},
watch: {
......
......@@ -2,8 +2,8 @@
/* global Flash */
import Store from './repo_store';
import Api from '../api';
import RepoMixin from './repo_mixin'
import Helper from './repo_helper'
import RepoMixin from './repo_mixin';
import Helper from './repo_helper';
const RepoCommitSection = {
data: () => Store,
......@@ -12,14 +12,12 @@ const RepoCommitSection = {
computed: {
branchPaths() {
let branch = Helper.getBranch();
return this.changedFiles.map((f) => {
return Helper.getFilePathFromFullPath(f.url, branch);
});
const branch = Helper.getBranch();
return this.changedFiles.map(f => Helper.getFilePathFromFullPath(f.url, branch));
},
filePluralize() {
return this.changedFiles.length > 1 ? 'files' : 'file'
return this.changedFiles.length > 1 ? 'files' : 'file';
},
},
......
......@@ -24,7 +24,7 @@ export default class RepoEditButton {
},
methods: {
editClicked() {
if(this.changedFiles.length) {
if (this.changedFiles.length) {
this.dialog.open = true;
return;
}
......
......@@ -71,11 +71,11 @@ const RepoEditor = {
readOnly,
});
if(this.editMode){
if (this.editMode) {
$('.project-refs-form').addClass('disabled');
$('.fa-long-arrow-right').show();
$('.project-refs-target-form').show();
}else{
} else {
$('.project-refs-form').removeClass('disabled');
$('.fa-long-arrow-right').hide();
$('.project-refs-target-form').hide();
......@@ -88,10 +88,10 @@ const RepoEditor = {
dialog: {
handler(obj) {
if(obj.status) {
if (obj.status) {
obj.status = false;
this.openedFiles.map((f) => {
if(f.active) {
if (f.active) {
this.blobRaw = f.plain;
}
f.changed = false;
......
......@@ -58,7 +58,7 @@ const RepoHelper = {
file.opened = true;
file.icon = 'fa-folder-open';
RepoHelper.toURL(file.url, file.name)
RepoHelper.toURL(file.url, file.name);
return file;
},
......@@ -281,7 +281,7 @@ const RepoHelper = {
history.pushState({ key: RepoHelper.key }, '', url);
if(title) {
if (title) {
document.title = `${title} · GitLab`;
}
},
......
......@@ -27,7 +27,7 @@ const RepoStore = {
minTabSize: 30,
tabsOverflow: 41,
submitCommitsLoading: false,
binaryLoaded:false,
binaryLoaded: false,
dialog: {
open: false,
title: '',
......@@ -60,7 +60,7 @@ const RepoStore = {
resetBinaryTypes() {
let s = '';
for(s in RepoStore.binaryTypes){
for (s in RepoStore.binaryTypes) {
RepoStore.binaryTypes[s] = false;
}
},
......
......@@ -20,7 +20,7 @@ const RepoTabs = {
xclicked(file) {
Store.removeFromOpenedFiles(file);
}
},
},
watch: {
......
......@@ -23,10 +23,10 @@ const PopupDialog = {
computed: {
typeOfClass() {
const className = `btn-${this.kind}`;
let returnObj = {};
const returnObj = {};
returnObj[className] = true;
return returnObj;
}
},
},
methods: {
......@@ -40,8 +40,8 @@ const PopupDialog = {
noClick() {
this.$emit('submit', false);
}
}
},
},
};
export default PopupDialog;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment