Skip to content

Commit ebd8d27

Browse files
committed
[feature] add bookmark button on empty groups
1 parent 0858aae commit ebd8d27

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

‎src/js/link.js‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,20 +1135,30 @@ var link = (function(){
11351135
vargroup=helper.node("div|class:group");
11361136
vargroupBody=helper.node("div|class:group-body");
11371137
varlinkEmpty=helper.node("div|class:link-empty");
1138-
varpara1=helper.node("p:No groups or bookmarks");
1139-
varpara2=helper.node("p:Why not add a one?|class:small muted");
1138+
varpara1=helper.node("p:No Groups or Bookmarks");
1139+
varbuttonWrap=helper.node("div|class:button-wrap mb-0");
1140+
varaddButton=helper.node("button:Add a Bookmark|class:button mb-0,type:button,tabindex:1");
1141+
buttonWrap.appendChild(addButton);
11401142
linkEmpty.appendChild(para1);
1141-
linkEmpty.appendChild(para2);
1143+
linkEmpty.appendChild(buttonWrap);
11421144
groupBody.appendChild(linkEmpty);
11431145
group.appendChild(groupBody);
1146+
addButton.addEventListener("click",function(event){
1147+
link.add.item.open();
1148+
},false);
11441149
returngroup;
11451150
},
11461151
item: function(){
11471152
varlinkEmpty=helper.node("div|class:link-empty");
11481153
varpara1=helper.node("p:Empty group");
1149-
varpara2=helper.node("p:Why not add a bookmark?|class:small muted");
1154+
varbuttonWrap=helper.node("div|class:button-wrap mb-0");
1155+
varaddButton=helper.node("button:Add a Bookmark|class:button mb-0,type:button,tabindex:1");
1156+
buttonWrap.appendChild(addButton);
11501157
linkEmpty.appendChild(para1);
1151-
linkEmpty.appendChild(para2);
1158+
linkEmpty.appendChild(buttonWrap);
1159+
addButton.addEventListener("click",function(event){
1160+
link.add.item.open();
1161+
},false);
11521162
returnlinkEmpty;
11531163
},
11541164
search: function(){

0 commit comments

Comments
(0)