Skip to content

Commit 6eef15a

Browse files
committed
compelte menu at version 0.1.5
1 parent 8ed34e3 commit 6eef15a

File tree

8 files changed

+132
-22
lines changed

8 files changed

+132
-22
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* 0.1.5
2+
- 去除滚动条和箭头按钮,增加菜单栏
3+
14
* 0.1.4
25
- 修复物料模式下的bug
36
- 增加表单/物料间切换的按钮

sdk.crx

-43 KB
Binary file not shown.

sdk/css/tool.css

+49-9
Original file line numberDiff line numberDiff line change
@@ -102,36 +102,76 @@ body {
102102
margin: 0;
103103
padding: 0;
104104
}
105+
.main {
106+
position: relative;
107+
-webkit-transition: top .3s;
108+
top: 0;
109+
}
105110
.menu {
106111
display: none;
107112
position: fixed;
108113
top: 10px;
109-
right: -225px;
110-
height: 25px;
111-
width: 225px;
112-
padding-left: 45px;
113-
background: url(../images/menu.png) no-repeat scroll 0 0;
114-
cursor: pointer;
114+
right: -256px;
115+
width: 300px;
115116
-webkit-transition: all .3s;
117+
z-index: 10;
116118
}
117119
.menu:hover {
118-
right: 10px;
120+
right: 0;
121+
}
122+
.menu .arrow {
123+
width: 45px;
124+
height: 34px;
125+
float: left;
126+
background: url(../images/menu.png) no-repeat scroll 10px 5px #eeeeee;
127+
box-shadow: 0px 0 4px 0 #cccccc;
128+
cursor: pointer;
119129
}
120130
.menu ul {
131+
float: left;
121132
margin: 0;
122133
padding: 0;
123134
list-style: none;
124135
background-color: #eeeeee;
136+
box-shadow: 0px 0 4px 0 #cccccc;
137+
cursor: pointer;
138+
opacity: 0.88;
125139
}
126140
.menu ul li {
127-
padding: 0 10px;
141+
position: relative;
142+
width: 205px;
143+
padding: 10px 10px 10px 40px;
128144
text-align: center;
145+
text-overflow: ellipsis;
146+
overflow: hidden;
147+
white-space: nowrap;
148+
}
149+
.menu ul li:first-of-type {
150+
border-left: 3px solid #eee;
151+
margin-left: -3px;
152+
}
153+
.menu ul li:hover {
154+
background-color: #dddddd;
155+
}
156+
.menu ul li.current {
157+
background-color: #f7f7dd;
158+
color: black;
159+
}
160+
.menu ul li img {
161+
max-height: 25px;
162+
max-width: 25px;
163+
position: absolute;
164+
top: 0;
165+
left: 10px;
166+
bottom: 0;
167+
right: 0;
168+
margin: auto 0;
129169
}
130170
.sdk-fieldset,
131171
.material-fieldset {
172+
height: 580px;
132173
padding: 0;
133174
margin: 0;
134-
margin-bottom: 5px;
135175
border: none;
136176
}
137177
.text-separate {

sdk/css/tool.less

+55-9
Original file line numberDiff line numberDiff line change
@@ -119,40 +119,86 @@ body {
119119
}
120120
}
121121

122+
.main {
123+
position: relative;
124+
-webkit-transition: top .3s;
125+
top: 0;
126+
}
127+
122128
.menu {
123129
display: none;
124130
position: fixed;
125131
top: 10px;
126-
right: -225px;
127-
height: 25px;
128-
width: 225px;
129-
padding-left: 45px;
130-
background: url(../images/menu.png) no-repeat scroll 0 0;
131-
cursor: pointer;
132+
right: -256px;
133+
width: 300px;
132134
-webkit-transition: all .3s;
135+
z-index: 10;
133136

134137
&:hover {
135-
right: 10px;
138+
right: 0;
139+
}
140+
141+
.arrow {
142+
width: 45px;
143+
height: 34px;
144+
float: left;
145+
background: url(../images/menu.png) no-repeat scroll 10px 5px #eeeeee;
146+
box-shadow: 0px 0 4px 0 #cccccc;
147+
cursor: pointer;
136148
}
137149

138150
ul {
151+
float: left;
139152
margin: 0;
140153
padding: 0;
141154
list-style: none;
142155
background-color: #eeeeee;
156+
box-shadow: 0px 0 4px 0 #cccccc;
157+
cursor: pointer;
158+
opacity: 0.88;
143159

144160
li {
145-
padding: 0 10px;
161+
position: relative;
162+
width: 205px;
163+
padding: 10px 10px 10px 40px;
146164
text-align: center;
165+
text-overflow: ellipsis;
166+
overflow: hidden;
167+
white-space: nowrap;
168+
169+
&:first-of-type {
170+
border-left: 3px solid #eee;
171+
margin-left: -3px;
172+
}
173+
174+
&:hover {
175+
background-color: #dddddd;
176+
}
177+
178+
&.current {
179+
background-color: #f7f7dd;
180+
color: black;
181+
}
182+
183+
img {
184+
max-height: 25px;
185+
max-width: 25px;
186+
position: absolute;
187+
top: 0;
188+
left: 10px;
189+
bottom: 0;
190+
right: 0;
191+
margin: auto 0;
192+
}
147193
}
148194
}
149195
}
150196

151197
.sdk-fieldset,
152198
.material-fieldset {
199+
height: 580px;
153200
padding: 0;
154201
margin: 0;
155-
margin-bottom: 5px;
156202
border: none;
157203
}
158204

sdk/images/menu.png

-5 Bytes
Loading

sdk/js/tool.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* legoSdkTool
3+
* @file tool.js
4+
* @author chestnut
5+
* @description 弹窗页的逻辑
6+
*/
7+
18
var popup = {};
29
var MESSAGE = {};
310

@@ -166,15 +173,29 @@ function Popup() {
166173
);
167174
};
168175

176+
function _bindEvents() {
177+
$('#menu').on('click', 'li', function (e) {
178+
var li = $(e.currentTarget);
179+
var index = li.attr('index');
180+
$('#main').css('top', -581 * index + 'px');
181+
$('#menu li.current').removeClass('current');
182+
li.addClass('current');
183+
});
184+
}
185+
169186
this._initMenu = function (datasource) {
170187
var tmpl = '';
171188
$.each(datasource, function (index, impl) {
189+
var className = index === 0 ? 'class="current"' : '';
190+
var img = impl.screenshot ? '<img src="' + impl.screenshot + '" />' : '';
172191
tmpl += ''
173-
+ '<li index=' + index + '>'
192+
+ '<li index="' + index + '" ' + className + '>'
193+
+ img
174194
+ (impl.templateName || impl.mcid)
175195
+ '</li>';
176196
});
177197
$('#menu ul').html(tmpl).parent().show();
198+
_bindEvents();
178199
};
179200

180201
this.init = function () {
@@ -394,8 +415,8 @@ function sdkPopup() {
394415
else {
395416
$('#main').hide();
396417
$('#sdkNotFound').show();
397-
Helper.waiting(false);
398418
}
419+
Helper.waiting(false);
399420
};
400421
}
401422

sdk/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SDK TOOL",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"icons": {
55
"128": "images/icon.png"
66
},

updates.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
33
<app appid='kiapedlmjgmhomenpmjfnieiialeikkf'>
4-
<updatecheck codebase='https://github.com/chestnutchen/legoSdkTool/raw/master/sdk.crx' version='0.1.4' />
4+
<updatecheck codebase='https://github.com/chestnutchen/legoSdkTool/raw/master/sdk.crx' version='0.1.5' />
55
</app>
66
</gupdate>

0 commit comments

Comments
 (0)