Skip to content

Commit

Permalink
Added a feature to clear SELECT tag before add options
Browse files Browse the repository at this point in the history
  • Loading branch information
railsjack committed Aug 9, 2019
1 parent cc58472 commit b97976a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions player/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var TutorialList = function () {

var _load = function () {
var cached_data_dir = _get_dir();
if(cached_data_dir) {
if (cached_data_dir) {
_load_script(cached_data_dir + '/list_mp4.js');
_load_script(cached_data_dir + '/list_vtt.js');
setTimeout(_load_html, 500);
Expand All @@ -56,7 +56,7 @@ var TutorialList = function () {

var _set_dir = function () {
const app = require('electron').remote.app
var basepath = app.getAppPath();
var basepath = _get_dir() || app.getAppPath();
const dialog = require('electron').remote.dialog
const data_dir = dialog.showOpenDialog(null, {
properties: ['openDirectory'],
Expand All @@ -73,9 +73,16 @@ var TutorialList = function () {
return cached_data_dir;
};

var _clear_html = function () {
while (tutorialList.childNodes.length > 0) {
tutorialList.removeChild();
}
};

var _load_html = function () {

_clear_html();

var temp_vtt_file_dir = '';
var optionNode;

Expand Down

0 comments on commit b97976a

Please sign in to comment.