Skip to content

Commit 553c566

Browse files
committed
Installable
1 parent 34a8a81 commit 553c566

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

install.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"resources": {
3+
"head": [
4+
{
5+
"type": "style",
6+
"src": "./css/sortable-theme-{{ options.theme }}.css"
7+
}
8+
],
9+
"body": [
10+
{
11+
"type": "script",
12+
"src": "./js/sortable.js"
13+
},
14+
{
15+
"type": "script",
16+
"src": "./js/install.js"
17+
}
18+
]
19+
},
20+
"options": {
21+
"properties": {
22+
"theme": {
23+
"title": "Theme",
24+
"type": "string",
25+
"enum": [
26+
"minimal",
27+
"light",
28+
"bootstrap",
29+
"slick",
30+
"dark",
31+
"finder"
32+
],
33+
"enumNames": {
34+
"minimal": "Minimal",
35+
"light": "Light",
36+
"bootstrap": "Bootstrap",
37+
"slick": "Slick",
38+
"dark": "Dark",
39+
"finder": "Finder"
40+
},
41+
"default": "minimal"
42+
},
43+
"": {
44+
45+
}
46+
}
47+
}
48+
}

js/install.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(function(){
2+
Array.prototype.forEach.call(document.querySelectorAll('table'), function(table){
3+
tables.setAttribute('data-sortable');
4+
tables.add('sortable-theme-' + INSTALL_OPTIONS.theme);
5+
});
6+
})();

0 commit comments

Comments
 (0)