Skip to content

Commit fabaed2

Browse files
author
Will Stone
committed
sorting handle
1 parent fa853ec commit fabaed2

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

src/main.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@ body {
3030
padding: 0;
3131
user-select: none;
3232

33+
.handle {
34+
display: inline-block;
35+
overflow: hidden;
36+
width: 16px;
37+
height: 20px;
38+
margin-top: -0.7em;
39+
margin-right: 0.3em;
40+
padding: 3px 4px;
41+
content: '....';
42+
cursor: move;
43+
vertical-align: middle;
44+
letter-spacing: 2px;
45+
color: #aaaaaa;
46+
font-size: 12px;
47+
font-weight: bold;
48+
line-height: 5px;
49+
50+
&:after {
51+
content: '.. .. .. ..';
52+
}
53+
}
54+
3355
> li {
3456
position: relative;
3557
display: flex;

src/preferences.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99

1010
<body id="preferences">
1111

12-
<ul id="browserList"><li>Loading..<li></ul>
12+
<ul id="browserList">
13+
<li>Loading&hellip;
14+
<li>
15+
</ul>
1316

1417
</body>
1518

1619
<script>
17-
require('./preferencesRenderer.js')
20+
require('./preferencesRenderer.js')
1821
</script>
1922

20-
</html>
23+
</html>

src/preferencesRenderer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function populatePreferences(installedBrowsers) {
6969
const li = document.createElement('li')
7070
li.classList.add('browserItem')
7171

72+
const handle = document.createElement('span')
73+
handle.classList.add('handle')
74+
li.appendChild(handle)
75+
7276
const logo = document.createElement('img')
7377
logo.classList.add('browserLogo')
7478
logo.src = `images/browser-logos/${browser.name}.png`
@@ -114,6 +118,7 @@ function populatePreferences(installedBrowsers) {
114118

115119
Sortable.create(browserList, {
116120
draggable: '.browserItem',
121+
handle: '.handle',
117122
onEnd: e => sortBrowser(e.oldIndex, e.newIndex)
118123
})
119124
} else {

0 commit comments

Comments
 (0)