Skip to content

Commit 27803fb

Browse files
committed
[feature] adding drag handle
1 parent 1e6f0e0 commit 27803fb

File tree

10 files changed

+43
-6
lines changed

10 files changed

+43
-6
lines changed

‎css/icons.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,7 @@
123123
.icon-refresh:before{
124124
content:"\e900";
125125
}
126+
127+
.icon-reorder:before{
128+
content:"\e901";
129+
}

‎fonts/icons/icons.eot‎

72 Bytes
Binary file not shown.

‎fonts/icons/icons.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎fonts/icons/icons.svg‎

Lines changed: 1 addition & 0 deletions
Loading

‎fonts/icons/icons.ttf‎

72 Bytes
Binary file not shown.

‎fonts/icons/icons.woff‎

72 Bytes
Binary file not shown.

‎js/link.js‎

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var link = (function(){
33
varbind=function(){
44
sortable(".link-area",{
55
items: ".link-item",
6+
handle: ".link-control-item-handle",
67
placeholder: helper.node("div|class:link-item-placeholder")
78
});
89
sortable(".link-area")[0].addEventListener("sortupdate",function(event){
@@ -85,6 +86,7 @@ var link = (function(){
8586
control.dependents();
8687
control.render();
8788
resetStagedBookmarkData();
89+
sortable(".link-area");
8890
},
8991
cancelAction: function(){
9092
resetStagedBookmarkData();
@@ -137,6 +139,7 @@ var link = (function(){
137139
render.tabIndex();
138140
_returnToPreviousFocusLink();
139141
resetStagedBookmarkData();
142+
sortable(".link-area");
140143
},
141144
cancelAction: function(){
142145
_returnToPreviousFocusLink();
@@ -162,6 +165,7 @@ var link = (function(){
162165
control.dependents();
163166
control.render();
164167
_returnToPreviousFocusLink();
168+
sortable(".link-area");
165169
},
166170
cancelAction: function(){
167171
_returnToPreviousFocusLink();
@@ -417,14 +421,37 @@ var link = (function(){
417421
value: "link-control"
418422
}]
419423
});
424+
varlinkHandle=helper.makeNode({
425+
tag: "button",
426+
attr: [{
427+
key: "class",
428+
value: "button button-small link-control-item link-control-item-handle"
429+
},{
430+
key: "tabindex",
431+
value: -1
432+
},{
433+
key: "title",
434+
value: "Drag and drop to reorder"
435+
}]
436+
});
437+
varlinkHandleIcon=helper.makeNode({
438+
tag: "span",
439+
attr: [{
440+
key: "class",
441+
value: "button-icon icon-reorder"
442+
}]
443+
});
420444
varlinkEdit=helper.makeNode({
421445
tag: "button",
422446
attr: [{
423447
key: "class",
424-
value: "button button-small link-control-item"
448+
value: "button button-small link-control-item link-control-item-edit"
425449
},{
426450
key: "tabindex",
427451
value: -1
452+
},{
453+
key: "title",
454+
value: "Edit this bookmark"
428455
}]
429456
});
430457
varlinkEditIcon=helper.makeNode({
@@ -438,10 +465,13 @@ var link = (function(){
438465
tag: "button",
439466
attr: [{
440467
key: "class",
441-
value: "button button-small link-control-item"
468+
value: "button button-small link-control-item link-control-item-remove"
442469
},{
443470
key: "tabindex",
444471
value: -1
472+
},{
473+
key: "title",
474+
value: "Remove this bookmark"
445475
}]
446476
});
447477
varlinkRemoveIcon=helper.makeNode({
@@ -458,9 +488,11 @@ var link = (function(){
458488
};
459489
linkPanelFront.appendChild(linkDisplay);
460490
linkPanelFront.appendChild(linkName);
491+
linkHandle.appendChild(linkHandleIcon);
492+
linkControl.appendChild(linkHandle);
461493
linkEdit.appendChild(linkEditIcon);
462-
linkRemove.appendChild(linkRemoveIcon);
463494
linkControl.appendChild(linkEdit);
495+
linkRemove.appendChild(linkRemoveIcon);
464496
linkControl.appendChild(linkRemove);
465497
linkUrl.appendChild(linkUrlText);
466498
linkPanelBack.appendChild(linkUrl);

‎js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="3.15.0";
3+
varcurrent="3.16.0";
44

55
varcompare=function(a,b){
66
varpa=a.split(".");

‎manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "3.15.0",
5+
"version": "3.16.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

‎screenshots/demo-007.gif‎

-141 KB
Loading

0 commit comments

Comments
(0)