efront 3.11.2 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/apps/kugou/api.js CHANGED
@@ -2,15 +2,18 @@
2
2
  "https://m.kugou.com/": {
3
3
  "song-info": "get app/i/getSongInfo.php?cmd=playInfo&from=mkugou&hash",
4
4
  "slider-src": "get:[].mod-slider>.swipe-wrap>div .#src=img!src&href=a!href",
5
- "songs-list": "get:[].panel-songslist>li .#hash=!id&.panel-songs-item-name>span!innerText",
6
- "rank-list": "get:[].panel-img-list>li rank/list#href=a!href&=a!href\\rank-info&imgurl=img!_src&name=p|innerText",
7
- "rank-info": "get:[].panel-songslist>li rank/info/:id#src=!id&name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
8
- "plist-index": "get:[].panel-img-list>li plist/index#href=a!href&=a!href\\plist-info&imgurl=img!_src&name=.panel-img-content-first|innerText&count=.panel-img-content-sub|innerText",
9
- "plist-info": "get:[].panel-songslist>li plist/list/:id#name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
5
+ "songs-list": "get:[].panel-songslist%20li .#hash=!id&.panel-songs-item-name>span!innerText",
6
+ "rank-list": "get:[].panel-img-list%20li rank/list#href=a!href&=a!href\\rank-info&imgurl=img!_src&name=p|innerText",
7
+ "rank-info": "get:[].panel-songslist%20li rank/info/:id#src=!id&name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
8
+ "plist-index": "get:[].panel-img-list%20li plist/index#href=a!href&=a!href\\plist-info&imgurl=img!_src&name=.panel-img-content-first|innerText&count=.panel-img-content-sub|innerText",
9
+ "plist-info": "get:[].panel-songslist%20li plist/list/:id#name=.panel-songs-item-name|innerText&data=.panel-songs-item-download/innerText",
10
10
  "search-hot": "get api/v3/search/hot?format=json&plat=0&count=30",
11
11
  "singer-class": "get:[].bd%20li singer/class#href=a!href&=a!href\\singer-list&name=a|innerText&group=?parentNode",
12
- "singer-list": "get:[].singer-img-list>li singer/list/:id#href=a!href&=a!href\\singer-info&imgurl=img!_src&name=p|innerText",
13
- "singer-info": "mget:[].singer-songs-list>li singer/info/:id#hash=!id&singer=.singer-name|innerText&name=.song-name|innerText&data=em/innerText"
12
+ "singer-list": "get:[].singer-img-list>li singer/list/:id#href=a!href&=a!href\\singer-info0&imgurl=img!_src&name=p|innerText",
13
+ "singer-info0": "mget:[].singer-songs-list>li singer/info/:id#hash=!id&singer=.singer-name|innerText&name=.song-name|innerText&data=em/innerText"
14
+ },
15
+ "https://www.kugou.com/": {
16
+ "singer-info": "cget:link[rel]+script yy/singer/home/:id.html",
14
17
  },
15
18
  "http://mobilecdn.kugou.com/": {
16
19
  "search?keyword": "get:data.info api/v3/search/song?format=json&page=1&pagesize=30&showtype=1"
@@ -1,5 +1,5 @@
1
1
  <div class="clusters">
2
- <a -repeat="(c,i) in clusters" ng-class="{current:i===index}" @click="active(i,c)">
2
+ <a -repeat="(c,i) in clusters" ng-class="{current:i===index.index}" @click="active(i,c)">
3
3
  <span -text="c"></span>
4
4
  </a>
5
5
  </div>
@@ -7,13 +7,13 @@ function main() {
7
7
  await this.clusters;
8
8
  this.active();
9
9
  },
10
- index: data.getInstance("index").index || 0,
10
+ index: data.getInstance("index"),
11
11
  clusters: [],
12
12
  filterTime(d) {
13
13
  return ((new Date - d) / 1000 | 0) + "秒";
14
14
  },
15
15
  clients: [],
16
- active(index = this.index) {
16
+ active(index = this.index.index | 0) {
17
17
  data.setInstance('index', { index });
18
18
  var clusters = this.clusters;
19
19
  if (index >= clusters.length) index = clusters.length - 1;
@@ -118,7 +118,7 @@ var scan = function (text) {
118
118
  }
119
119
 
120
120
  if (/^\-(\s|$)/.test(row)) {
121
- if (data || span > spacesize) push();
121
+ if (data || span >= spacesize) push();
122
122
  if (!parents[spacesize]) {
123
123
  var obj = [];
124
124
  push(obj);
@@ -48,11 +48,13 @@ var parse一二三 = function (a) {
48
48
  };
49
49
  var map甲乙丙 = createMap("甲乙丙丁戊己庚辛壬癸");
50
50
  var map子丑寅 = createMap("子丑寅卯辰巳午未申酉戌亥");
51
+ var map上中下 = createMap("前上中下后");
51
52
 
52
53
  var reg123 = /^(\d+|\d+[\.\d]+\d+)[\s\S]*$/;
53
54
  var reg一二三 = /^([一二三四五六七八九十百千万亿壹贰叁肆伍陆柒捌玖拾佰仟萬零〇]+)[\s\S]*$/;
54
55
  var reg甲乙丙 = /^([甲乙丙丁戊己庚辛壬癸])[\s\S]*$/;
55
56
  var reg子丑寅 = /^([子丑寅卯辰巳午未申酉戌亥])[\s\S]*$/;
57
+ var reg上中下 = /^([前上中下后])[\s\S]*$/;
56
58
  var reg天干地支 = /^([甲乙丙丁戊己庚辛壬癸][子丑寅卯辰巳午未申酉戌亥])[\s\S]*$/;
57
59
 
58
60
  var getDelta = function (a, b, reg, parse) {
@@ -85,14 +87,14 @@ var compare = function (a, b) {
85
87
  for (var cx1 = a.length - 1, cx2 = b.length - 1; cx1 >= 0 && cx2 >= 0; cx1--, cx2--) {
86
88
  while (/\s\u00a0/.test(a[cx1])) cx1--;
87
89
  while (/\s\u00a0/.test(b[cx2])) cx2--;
88
- if (a[cx1] !== b[cx2] || a[cx1] in map子丑寅 || a[cx1] in map一二三 || a in power || /^\d$/.test(a[cx1])) break;
90
+ if (a[cx1] !== b[cx2] || a[cx1] in map子丑寅 || a[cx1] in map上中下 || a[cx1] in map一二三 || a in power || /^\d$/.test(a[cx1])) break;
89
91
  }
90
92
  a = a.slice(0, cx1 + 1);
91
93
  b = b.slice(0, cx2 + 1);
92
94
  for (var cx1 = 0, cx2 = 0, dx1 = b.length, dx2 = b.length; cx1 < dx1 && cx2 < dx2; cx1++, cx2++) {
93
95
  while (/[\s\u00a0]/.test(a[cx1])) cx1++;
94
96
  while (/[\s\u00a0]/.test(b[cx2])) cx2++;
95
- if (a[cx1] !== b[cx2] || a[cx1] in map甲乙丙 || a[cx1] in map一二三 || a in power || /^\d/.test(a[cx1])) break;
97
+ if (a[cx1] !== b[cx2] || a[cx1] in map甲乙丙 || a[cx1] in map上中下 || a[cx1] in map一二三 || a in power || /^\d/.test(a[cx1])) break;
96
98
  }
97
99
  if (cx1) a = a.slice(cx1);
98
100
  if (cx2) b = b.slice(cx2);
@@ -108,6 +110,8 @@ var compare = function (a, b) {
108
110
  if (delta) return delta;
109
111
  delta = getDelta(a, b, reg子丑寅, d => map子丑寅[d]);
110
112
  if (delta) return delta;
113
+ delta = getDelta(a, b, reg上中下, d => map上中下[d]);
114
+ if (delta) return delta;
111
115
  return 0;
112
116
  }
113
117
  function sortname(list = this) {
@@ -33,10 +33,23 @@
33
33
  };
34
34
  var parseMenuList = function (items) {
35
35
  if (items instanceof Array) {
36
+ if (!items[0] || !items[0].name) {
37
+ var items1 = [];
38
+ for (var cx = 0, dx = items.length; cx < dx; cx++) {
39
+ var item = items[cx];
40
+ if (!item) continue;
41
+ item = parseMenuList(item);
42
+ items1.push.apply(items1, item);
43
+ items1.push({ line: true });
44
+ }
45
+ items1.pop();
46
+ items = items1;
47
+ }
36
48
  return items;
37
49
  }
38
50
  if (items instanceof Object) {
39
51
  var keys = Object.keys(items);
52
+
40
53
  items = keys.map(k => {
41
54
  var c = items[k];
42
55
  var item = {};
@@ -54,7 +67,8 @@
54
67
  if (/,/.test(name)) {
55
68
  var [name, ...roles] = name.split(',');
56
69
  }
57
- item.name = name;
70
+ if (/^\-+$/.test(name)) item.line = true;
71
+ else item.name = name;
58
72
  if (roles) item.roles = roles;
59
73
  if (path) item.path = path;
60
74
  if (data) item.params = parseKV(data);
@@ -68,6 +82,8 @@
68
82
  return [];
69
83
  };
70
84
  result.update = function (items) {
85
+ delete result.loading_promise;
86
+ delete result.then;
71
87
  items = parseMenuList(items);
72
88
  items.map(getChildren);
73
89
  var opened = data.getInstance("menu-opened");
@@ -174,10 +190,19 @@
174
190
  result.load(result.active);
175
191
  return result;
176
192
  };
177
- result.fetch = function (url) {
178
- data.from(url).loading_promise.then(result.update);
193
+ result.from = result.fetch = function (url) {
194
+ result.loading_promise = data.from(url).loading_promise.then(result.update);
195
+ result.then = then;
179
196
  return result;
180
197
  };
198
+ var then = function (ok, oh) {
199
+ if (this.loading_promise) {
200
+ return this.loading_promise.then(ok, oh);
201
+ }
202
+ delete result.then;
203
+ ok(result);
204
+ result.then = then;
205
+ };
181
206
  result.update(items);
182
207
  return result;
183
208
  });
@@ -1,10 +1,24 @@
1
- a => a.map(b => {
2
- var data = {};
3
- if (b.data) extend(data, {
4
- name: b.data.filename.replace(/^[\s\S]*?\s*\-\s*/, ''),
5
- singer: b.data.filename.replace(/\s*\-\s*[\s\S]*?$/, '')
6
- }, b.data);
7
- else extend(data, b);
8
- if (data.hash) data.hash = data.hash.replace(/^songs\_/i, '');
9
- return data;
10
- });
1
+ a => {
2
+ if (isElement(a)) {
3
+ var m = /songsdata\s*=\s*(\[[\s\S]*\])/.exec(a.innerText);
4
+ if (!m) throw new Error("无法加载数据!");
5
+ if (m) a = m[1];
6
+ a = JSON.parse(a);
7
+ console.log(a)
8
+ }
9
+ return a.map(b => {
10
+ var data = {};
11
+ if (b.data) extend(data, {
12
+ name: b.data.filename.replace(/^[\s\S]*?\s*\-\s*/, ''),
13
+ singer: b.data.filename.replace(/\s*\-\s*[\s\S]*?$/, '')
14
+ }, b.data);
15
+ else extend(data, b);
16
+ if (!data.singer) {
17
+ data.singer = data.author_name;
18
+ }
19
+ if (!data.name) data.name = data.audio_name;
20
+ if (data.hash) data.hash = data.hash.replace(/^songs\_/i, '');
21
+ return data;
22
+ });
23
+
24
+ }
@@ -19,6 +19,7 @@ function Item(value) {
19
19
  this.icon = value.icon;
20
20
  this.color = value.color;
21
21
  this.test = value.test;
22
+ this.line = value.line;
22
23
  }
23
24
  this.count = 0;//子项中的叶子节点数
24
25
  this.total = 0;//子项中的节点数
@@ -18,7 +18,8 @@
18
18
  outline: none;
19
19
  user-select: none;
20
20
  }
21
- >.label{
21
+
22
+ >.label {
22
23
  position: relative;
23
24
  }
24
25
 
@@ -91,7 +92,7 @@
91
92
 
92
93
  >.track {
93
94
  background: #0001;
94
- box-shadow: inset 0 0 6px 6px #6fc3;
95
+ box-shadow: inset 0 0 6px 6px #00000006;
95
96
  }
96
97
  }
97
98
 
@@ -1,13 +1,9 @@
1
1
 
2
2
  var _slider = createElement(div);
3
- var empty = function (index, item) {
4
- if (!item) return;
5
- return document.createElement('empty');
6
- };
7
- var getGenerator = function (container) {
3
+ var getGenerator = function (container, tagName = 'item') {
8
4
  if (!container) return;
9
- if (!container.childNodes.length) return container.$generator || empty;
10
- var template = document.createElement("div");
5
+ if (!container.childNodes.length && container.$generator) return container.$generator;
6
+ var template = document.createElement(tagName);
11
7
  var templates = [].concat.apply([], container.childNodes).filter(a => {
12
8
  if (a.hasAttribute('insert')) {
13
9
  return false;
@@ -25,17 +21,24 @@ var getGenerator = function (container) {
25
21
  appendChild(template, templates);
26
22
  container.insertBefore = _slider.insertBefore;
27
23
  container.appendChild = _slider.appendChild;
28
- var scopes = container.$parentScopes.concat(container.$scope);
29
- return container.$generator = function (index, com) {
30
- if (!com) {
24
+ var scopes = container.$parentScopes || [];
25
+ if (container.$scope) scopes = scopes.concat(container.$scope);
26
+ return container.$generator = function (index, com, element) {
27
+ if (com === undefined) {
31
28
  if (!container.src || index >= container.src.length) return;
32
29
  com = container.src[index];
33
30
  }
34
- if (!com) return;
35
- var template1 = template.cloneNode(true);
36
- if (!template1.childNodes.length) return template1;
37
- var item = template1.childNodes[0];
38
- item.with = [].concat.apply([], template1.childNodes).slice(1);
31
+ if (com === undefined) return;
32
+ if (!element) {
33
+ var template1 = template.cloneNode(true);
34
+ if (!template1.childNodes.length) {
35
+ element = template1;
36
+ }
37
+ else {
38
+ element = template1.childNodes[0];
39
+ if (template1.childNodes.length > 1) element.with = [].concat.apply([], template1.childNodes).slice(1);
40
+ }
41
+ }
39
42
  var parsedSrc = container.$src;
40
43
  if (parsedSrc) {
41
44
  var { keyName, itemName, indexName } = parsedSrc;
@@ -44,8 +47,8 @@ var getGenerator = function (container) {
44
47
  [itemName || '$item']: com,
45
48
  [indexName || '$index']: index
46
49
  };
47
- var newItem = render(item, newScope, scopes);
48
- if (item.with.length) newItem.with = render(item.with, newScope, scopes);
50
+ var newItem = render(element, newScope, scopes);
51
+ if (element.with) newItem.with = render(element.with, newScope, scopes);
49
52
  } else {
50
53
  var newScope = container.src[index];
51
54
  if (!isObject(newScope)) newScope = {
@@ -65,8 +68,8 @@ var getGenerator = function (container) {
65
68
  return this.$item;
66
69
  }
67
70
  }
68
- var newItem = render(item, newScope, scopes);
69
- newItem.with = render(newItem.with = item.with, newScope, scopes);
71
+ var newItem = render(element, newScope, scopes);
72
+ if (element.with) newItem.with = render(newItem.with = element.with, newScope, scopes);
70
73
  }
71
74
  return newItem;
72
75
  };
@@ -60,6 +60,28 @@ function ylist(container, generator, $Y) {
60
60
  }
61
61
  return null;
62
62
  };
63
+ var hasCover = function (child) {
64
+ var scrollTop = list.scrollTop;
65
+ if (child.offsetTop + child.offsetHeight < scrollTop || child.offsetTop >= scrollTop + list.clientHeight) return false;
66
+ if (child.offsetTop <= scrollTop && child.offsetTop + child.offsetHeight >= scrollTop + list.clientHeight) return true;
67
+ if (child.offsetTop < scrollTop) return false;
68
+ if (child.offsetTop + child.offsetHeight > scrollTop + list.clientHeight) return false;
69
+ return true;
70
+ };
71
+ var scrollIfNotCover = function (index) {
72
+ var c = getIndexedElement(index);
73
+ if (!c) return scrollTo(index);
74
+ if (hasCover(c)) return;
75
+ var scrollTop = list.scrollTop;
76
+ var deltat = scrollTop - c.offsetTop;
77
+ var deltab = c.offsetTop + c.offsetHeight - scrollTop - list.clientHeight;
78
+ if (deltat > 0) {
79
+ return scrollBy(-deltab > deltat ? -deltat : -deltab);
80
+ }
81
+ if (deltab > 0) {
82
+ return scrollBy(deltab < deltat ? deltat : deltab);
83
+ }
84
+ };
63
85
  var getLastVisibleElement = function (deltaY = 0) {
64
86
  var { scrollTop } = list;
65
87
  scrollTop += deltaY;
@@ -85,6 +107,7 @@ function ylist(container, generator, $Y) {
85
107
  return map;
86
108
  };
87
109
  var createItem = function (index) {
110
+ console.log(index)
88
111
  var item = generator(index);
89
112
  if (item) {
90
113
  item.index = index;
@@ -102,10 +125,10 @@ function ylist(container, generator, $Y) {
102
125
  }
103
126
  var cache_height = list.offsetHeight;
104
127
  var index = itemIndex | 0;
128
+ if (itemIndex < 0) index--;
105
129
  var ratio = itemIndex - index || 0;
106
- if (index < 0) index = 0;
107
130
  var childrenMap = getChildrenMap();
108
- var offsetBottom = 0, ratioTop = 0, offset = +index || 0, last_item = getFirstElement() || null, last_index = last_item && last_item.index || offset;
131
+ var offsetBottom = 0, ratioTop = 0, offset = index, last_item = getFirstElement() || null, last_index = last_item && last_item.index || offset;
109
132
  var count = 0, delta = 1, bottom_item, offsett = offset, offsetb = offset, top_item;
110
133
  var indexed_item;
111
134
  while (offsetBottom - ratioTop <= list.clientHeight + cache_height || indexed_item && top_item && indexed_item.offsetTop - top_item.offsetTop < cache_height) {
@@ -181,7 +204,9 @@ function ylist(container, generator, $Y) {
181
204
  var currentY = function () {
182
205
  var firstElement = getFirstElement(1);
183
206
  if (!firstElement) return;
184
- return firstElement.index * firstElement.offsetHeight + list.scrollTop;
207
+ var index = firstElement.index;
208
+ if (index < 0) index = index - index | 0;
209
+ return index * firstElement.offsetHeight + list.scrollTop;
185
210
  };
186
211
  var getBottomElement = function (last_element) {
187
212
  if (!last_element) return null;
@@ -237,8 +262,6 @@ function ylist(container, generator, $Y) {
237
262
  let item = childrenMap[k];
238
263
  if (item.offsetTop + getOffsetHeight(item) + cache_height < scrollTop) {
239
264
  collection.push(item);
240
- } else {
241
- break;
242
265
  }
243
266
  }
244
267
  if (collection.length) {
@@ -280,9 +303,6 @@ function ylist(container, generator, $Y) {
280
303
  if (!(scrollTop < targetHeight)) {
281
304
  paddingCount--;
282
305
  }
283
- if (!(offset >= 0)) {
284
- break;
285
- }
286
306
  var item = childrenMap[offset];
287
307
  if (!item) {
288
308
  item = createItem(offset);
@@ -313,7 +333,6 @@ function ylist(container, generator, $Y) {
313
333
  } else {
314
334
  deltaScroll = patchTop(deltaY, animate);
315
335
  }
316
-
317
336
  if (deltaScroll) {
318
337
  if (animate && __scrollBy) {
319
338
  list.scrollTop += deltaScroll - deltaY;
@@ -378,13 +397,20 @@ function ylist(container, generator, $Y) {
378
397
  };
379
398
  if (!/^i(Phone|Pod|Watch|Pad)|^Mac/i.test(navigator.platform)) var __scrollBy = list.scrollBy;
380
399
  list.scrollBy = scrollBy;
381
- list.index = function () {
400
+ list.index = function (update) {
401
+ if (update === false) return saved_itemIndex;
382
402
  var firstElement = getFirstVisibleElement();
383
403
  if (!firstElement) return saved_itemIndex;
384
404
  var index = firstElement.index;
385
405
  var scrolled = (list.scrollTop - firstElement.offsetTop + parseFloat(getComputedStyle(list).paddingTop)) / firstElement.offsetHeight;
386
406
  return index + scrolled;
387
407
  };
408
+ on("remove")(list, function () {
409
+ saved_itemIndex = list.index();
410
+ });
411
+ on("append")(list, function () {
412
+ if (isFinite(saved_itemIndex)) list.go(saved_itemIndex);
413
+ })
388
414
  list.topIndex = function () {
389
415
  var element = getFirstElement(1);
390
416
  return element ? element.index : 0;
@@ -392,6 +418,7 @@ function ylist(container, generator, $Y) {
392
418
  list.getIndexedElement = getIndexedElement;
393
419
  list.patchBottom = patchBottom;
394
420
  list.patchTop = patchTop;
421
+ list.scrollIfNotCover = scrollIfNotCover;
395
422
  vbox(list, $Y);
396
423
  return list;
397
424
  }
@@ -400,7 +427,7 @@ var xlist = arriswise(ylist, allArgumentsNames.concat([].slice.call(arguments, 0
400
427
 
401
428
  var getGeneratorFromArray = function (source) {
402
429
  return function (index) {
403
- if (index >= source.length) return null;
430
+ if (index >= source.length || index < 0) return null;
404
431
  return block(source[index]);
405
432
  };
406
433
  };
@@ -1,5 +1,5 @@
1
1
  var listX = list(function (index) {
2
- if(index>100)return;
2
+ if (index > 100 || index < 0) return;
3
3
  var item = div();
4
4
  css(item, `height:100%;width:${Math.random() * 110 + 30}px;border:1px solid;`);
5
5
  text(item, index);
@@ -10,7 +10,7 @@ onappend(listX, function () {
10
10
  });
11
11
  css(listX, "width:360px;height:160px;");
12
12
  var listY = list(function (index) {
13
- if(index>100)return;
13
+ if (index > 100 || index < 0) return;
14
14
  var item = div();
15
15
  css(item, `width:100%;height:${Math.random() * 110 + 30}px;border:1px solid;`);
16
16
  text(item, index);
@@ -117,8 +117,9 @@ function main(elem, mode) {
117
117
  case "inline":
118
118
  case "t":
119
119
  case "tree":
120
+ mode = "tree";
120
121
  if (elem) {
121
- var generator = getGenerator(elem);
122
+ var generator = getGenerator(elem, 'menu-item');
122
123
  tree(elem, function (index, item) {
123
124
  var e = generator(index, item);
124
125
  if (!e || e.children.length) return e;
@@ -156,7 +157,7 @@ function main(elem, mode) {
156
157
  active(elem, item, item.value, target);
157
158
  };
158
159
  if ("$src" in elem) {
159
- getGenerator(elem);
160
+ getGenerator(elem, 'menu-item');
160
161
  care(elem, function (src) {
161
162
  menuList(elem, getTreeFromData(src), emit, direction);
162
163
  elem.registerAsRoot();
@@ -164,6 +165,7 @@ function main(elem, mode) {
164
165
  }
165
166
  else {
166
167
  var nodes = getArrayNodes(elem);
168
+ remove(elem.children);
167
169
  elem = menuList(elem, nodes, emit, direction);
168
170
  elem.registerAsRoot();
169
171
  }
@@ -92,12 +92,15 @@ body:active & {
92
92
  display: block;
93
93
  overflow: hidden;
94
94
  text-overflow: hidden;
95
- line-height: 40px;
96
95
  position: relative;
97
96
  border-bottom: 1px solid #18333c;
97
+ border-top: none;
98
+ border-left: none;
99
+ border-right: none;
98
100
  padding: 0;
99
101
 
100
102
  menu-item {
103
+ line-height: 24px;
101
104
  display: inline-block;
102
105
 
103
106
  &.has-children:after {
@@ -110,11 +113,9 @@ body:active & {
110
113
  vertical-align: top;
111
114
  }
112
115
 
113
- .button {
114
- line-height: 40px;
115
- }
116
116
  }
117
117
 
118
+ &[mode=tree],
118
119
  &[mode=tree],
119
120
  &[type=tree],
120
121
  &[mode=inline],
@@ -122,46 +123,46 @@ body:active & {
122
123
  height: auto;
123
124
  box-shadow: none;
124
125
  padding: 0;
125
- margin: 0;
126
-
127
- // &[browser=samsung] {
128
- // .tab1 {
129
- // &.open s {
130
- // overflow : visible;
131
- // text-indent: -6.6pt;
132
- // }
133
- // &.closed s{
134
- // overflow : visible;
135
- // text-indent: 3.1pt;
136
- // }
137
- // }
138
- // }
139
-
140
- // &[browser=firefox] {
141
- // .tab1 {
142
- // &.open s {
143
- // text-indent: -8.6px;
144
- // }
145
-
146
- // &.closed s {
147
- // text-indent: -4.1px;
148
- // }
149
- // }
150
- // }
151
-
152
- // &[browser=safari] {
153
- // .tab1 {
154
- // &.open s {
155
- // text-indent: -5.6px;
156
- // }
157
-
158
- // &.closed s {
159
- // text-indent: -1.1px;
160
- // }
161
- // }
162
- // }
163
-
164
- .tab1 {
126
+
127
+ >.button {
128
+ box-shadow: none;
129
+ padding-top: 6px;
130
+ padding-bottom: 6px;
131
+ line-height: 20px;
132
+ font-size: 14px;
133
+
134
+ >b {
135
+ font-weight: normal;
136
+ }
137
+
138
+ &:not(.tab1) {
139
+ display: block;
140
+ background: #2c3b41;
141
+ color: #8aa4af;
142
+
143
+ &.checked,
144
+ &.actived,
145
+ &.selected {
146
+ color: #fff;
147
+ }
148
+ }
149
+
150
+ i {
151
+ margin-right: 10px;
152
+ }
153
+
154
+
155
+ &.hover {
156
+ text-shadow: none;
157
+ color: #fff;
158
+ }
159
+
160
+ }
161
+
162
+ >.tab1 {
163
+ font-size: 16px;
164
+ line-height: 28px;
165
+
165
166
  &.open {
166
167
  color: #fff;
167
168
  background: #1e282c;
@@ -218,45 +219,13 @@ body:active & {
218
219
 
219
220
  border-left: 3px solid transparent;
220
221
  display : block;
221
- height : 44px;
222
- line-height: 44px;
223
222
  font-size : 14px;
224
223
  color : #b8c7ce;
225
224
  }
226
225
 
227
- >.button {
228
- box-shadow: none;
229
-
230
-
231
- >b {
232
- font-weight: normal;
233
- }
234
-
235
- &:not(.tab1) {
236
- display: block;
237
- height: 36px;
238
- line-height: 36px;
239
- font-size: 14px;
240
- background: #2c3b41;
241
- color: #8aa4af;
242
-
243
- &.checked,
244
- &.actived,
245
- &.selected {
246
- color: #fff;
247
- }
248
- }
249
-
250
- i {
251
- margin-right: 10px;
252
- }
253
-
254
-
255
- &.hover {
256
- text-shadow: none;
257
- color: #fff;
258
- }
259
-
226
+ >[line],
227
+ >.line {
228
+ line-height: 0;
229
+ font-size: 0;
260
230
  }
261
-
262
231
  }
@@ -1,3 +1,4 @@
1
+ var preventDefault = function (e) { e.preventDefault() };
1
2
  function main(elem, scope, hasIcon) {
2
3
  var item = elem || document.createElement('menu-item');
3
4
  item.innerHTML = menuItem;
@@ -11,5 +12,6 @@ function main(elem, scope, hasIcon) {
11
12
  var icon = scope.icon;
12
13
  if (hasIcon === undefined) hasIcon = !!icon;
13
14
  render(item.children, { useIcon: hasIcon, hasIcon, name, icon });
15
+ if (scope.line) item.setAttribute("line", ''), on("click")(item, preventDefault);
14
16
  return item;
15
17
  }