Commit 5ea4942a authored by Jacob Schatz's avatar Jacob Schatz

Disabled and show dropdowns at the right times.

parent aad39a7b
...@@ -24,6 +24,11 @@ function repoEditorLoader() { ...@@ -24,6 +24,11 @@ function repoEditorLoader() {
}); });
} }
function initDropdowns() {
$('.project-refs-target-form').hide();
$('.fa-long-arrow-right').hide();
}
function addEventsForNonVueEls() { function addEventsForNonVueEls() {
$(document).on('change', '.dropdown', () => { $(document).on('change', '.dropdown', () => {
Store.targetBranch = $('.project-refs-target-form input[name="ref"]').val(); Store.targetBranch = $('.project-refs-target-form input[name="ref"]').val();
...@@ -56,6 +61,7 @@ function initRepo() { ...@@ -56,6 +61,7 @@ function initRepo() {
Store.currentBranch = $('button.dropdown-menu-toggle').attr('data-ref'); Store.currentBranch = $('button.dropdown-menu-toggle').attr('data-ref');
Store.checkIsCommitable(); Store.checkIsCommitable();
addEventsForNonVueEls(); addEventsForNonVueEls();
initDropdowns();
this.vm = new Vue({ this.vm = new Vue({
el: repo, el: repo,
......
...@@ -70,6 +70,16 @@ const RepoEditor = { ...@@ -70,6 +70,16 @@ const RepoEditor = {
this.monacoInstance.updateOptions({ this.monacoInstance.updateOptions({
readOnly, readOnly,
}); });
if(this.editMode){
$('.project-refs-form').addClass('disabled');
$('.fa-long-arrow-right').show();
$('.project-refs-target-form').show();
}else{
$('.project-refs-form').removeClass('disabled');
$('.fa-long-arrow-right').hide();
$('.project-refs-target-form').hide();
}
}, },
activeFileLabel() { activeFileLabel() {
......
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
.project-refs-form, .project-refs-target-form { .project-refs-form, .project-refs-target-form {
display: inline-block; display: inline-block;
&.disabled {
opacity: 0.5;
pointer-events: none;
}
} }
.fade-enter, .fade-enter,
......
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