added tippy.js for testing

This commit is contained in:
huangjx
2021-10-28 15:31:07 +08:00
parent 9670ec883e
commit 11969a4b23
3 changed files with 16 additions and 10 deletions

View File

@@ -8,10 +8,12 @@ import './css/style.scss'
import './css/table.scss'
import { createApp } from 'vue'
import App from './App';
import tippy, { delegate } from 'tippy.js';
import 'tippy.js/dist/tippy.css';
'use strict'
const basePath = "/apps/ncdownloader";
window.addEventListener('DOMContentLoaded', function () {
// inputAction.run();
@@ -22,7 +24,7 @@ window.addEventListener('DOMContentLoaded', function () {
let vm = app.mount('#' + container);
helper.addVue(vm.$options.name, vm);
eventHandler.add("click","#start-aria2 button", function (e) {
eventHandler.add("click", "#start-aria2 button", function (e) {
const path = basePath + "/aria2/start";
let url = helper.generateUrl(path);
Http.getInstance(url).setHandler(function (data) {
@@ -34,6 +36,9 @@ window.addEventListener('DOMContentLoaded', function () {
window.location.href = link;
})
eventHandler.add("click", "#app-navigation", "#search-download", helper.showDownload);
delegate('#ncdownloader-table-wrapper',
{ target: '[data-tippy-content]' }
);
});

View File

@@ -135,6 +135,7 @@ class ncTable {
if (name == 'refresh') {
name = 'Redownload';
}
button.setAttribute("data-tippy-content", helper.ucfirst(name));
button.setAttribute("title", helper.ucfirst(name));
return button;
}