未验证 提交 098a9805 编写于 作者: P Phil Hughes

spec fixes

increased perf of scrolling tabs into view
上级 5c75d750
<script>
import { mapActions, mapState } from 'vuex';
import { mapActions } from 'vuex';
import { __ } from '../../../locale';
import popupDialog from '../../../vue_shared/components/popup_dialog.vue';
......@@ -28,7 +28,7 @@
]),
createEntryInStore() {
this.createTempEntry({
name: this.entryName.replace(new RegExp(`^${this.path}\/`), ''),
name: this.entryName.replace(new RegExp(`^${this.path}/`), ''),
type: this.type,
});
......
......@@ -26,12 +26,14 @@ export default {
RepoPreview,
},
mounted() {
const alertMessage = 'Are you sure you want to lose unsaved changes?';
const returnValue = 'Are you sure you want to lose unsaved changes?';
window.onbeforeunload = (e) => {
if (!this.changedFiles.length) return undefined;
e.returnValue = alertMessage;
return alertMessage;
Object.assign(e, {
returnValue,
});
return returnValue;
};
},
};
......
......@@ -8,7 +8,7 @@ export default {
'activeFile',
]),
renderErrorTooLarge() {
return this.activeFile.renderError == 'too_large';
return this.activeFile.renderError === 'too_large';
},
},
methods: {
......
......@@ -2,9 +2,6 @@ import Vue from 'vue';
import flash from '../../flash';
import service from '../services';
import * as types from './mutation_types';
import {
pushState,
} from './utils';
export const redirectToUrl = url => gl.utils.visitUrl(url);
......@@ -118,9 +115,9 @@ export const scrollToTab = () => {
const tabs = document.getElementById('tabs');
if (tabs) {
const tabEl = tabs.querySelector('.active');
const tabEl = tabs.querySelector('.active .repo-tab');
tabs.scrollLeft = tabEl.offsetLeft;
tabEl.focus();
}
});
};
......
......@@ -41,7 +41,9 @@
}
.panel-right {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
width: 80%;
height: 100%;
......@@ -73,6 +75,7 @@
}
.blob-viewer-container {
-webkit-flex: 1;
flex: 1;
overflow: auto;
......
......@@ -28,7 +28,7 @@ feature 'Multi-file editor new file', :js do
click_button('Create file')
end
find('.inputarea', visible: false).send_keys('file content')
find('.inputarea').send_keys('file content')
fill_in('commit-message', with: 'commit message')
......
......@@ -10,7 +10,11 @@ describe('new dropdown component', () => {
beforeEach(() => {
const component = Vue.extend(newDropdown);
vm = createComponentWithStore(component, store).$mount();
vm = createComponentWithStore(component, store);
vm.$store.state.path = '';
vm.$mount();
});
afterEach(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册