Skip to content

Commit

Permalink
Fix issue #22
Browse files Browse the repository at this point in the history
- save button now closes Preferences modal window
- hitting Enter button in Preferences window will not create empty download task
  • Loading branch information
zaharcelac committed Feb 26, 2021
1 parent 097858e commit d025169
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions youtube_dl_webui/static/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ var videoDownload = (function (Vue, extendAM){
}, function(err){
_self.showAlertToast(err, 'error');
});
_self.showModal = false;
},
removeTask: function(){
var _self = this;
Expand Down
10 changes: 7 additions & 3 deletions youtube_dl_webui/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@
<hr class="left-hr" /><span style="font-weight: bold;">General</span><hr class="right-hr" />
</div>
<div>
<label>Download Path:</label><input type="text" ref="dl-path" v-model="modalData.preference.general.download_dir" v-cloak @keyup.enter="addTask" @keyup.esc="showModal = false"/>
<label>Download Path:</label><input type="text" ref="dl-path" v-model="modalData.preference.general.download_dir" v-cloak @keyup.esc="showModal = false"/>
</div>
<div>
<label>Database Path:</label><input type="text" ref="db-path" v-model="modalData.preference.general.db_path" v-cloak @keyup.enter="addTask" @keyup.esc="showModal = false"/>
<label>Database Path:</label><input type="text" ref="db-path" v-model="modalData.preference.general.db_path" v-cloak @keyup.esc="showModal = false"/>
</div>
<div>
<label>Log Size:</label><input type="text" ref="log-size" v-model="modalData.preference.general.log_size" v-cloak @keyup.enter="addTask" @keyup.esc="showModal = false"/>
<label>Log Size:</label><input type="text" ref="log-size" v-model="modalData.preference.general.log_size" v-cloak @keyup.esc="showModal = false"/>
</div>
<div style="text-align:center;">
<hr class="left-hr" /><span style="font-weight: bold;">youtube-dl options</span><hr class="right-hr" />
Expand All @@ -136,6 +136,10 @@
<label>Proxy:</label><input type="text" ref="proxy" v-model="modalData.preference.youtube_dl.proxy" v-cloak @keyup.esc="showModal = false"/>
</div>
</div>
<div slot="footer">
<button class="modal-default-button" @click="updatePreference" style="width:auto;">save</button>
<button class="modal-default-button" @click="showModal = false" style="width:auto;">cancel</button>
</div>
</template>
<template v-if="modalType === 'about'">
<div slot="header">About</div>
Expand Down

0 comments on commit d025169

Please sign in to comment.