Skip to content

Commit 377b727

Browse files
author
Jessica Shi
committed
fix bug, clean up CSS
1 parent 4c926ca commit 377b727

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

codegen.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expressi
8080
<thead>
8181
<tr>
8282
<th class="mdl-data-table__cell--non-numeric" width="100"><div align="center" style="position:relative"><big>Tensor</big></div></th>
83-
<th class="mdl-data-table__cell--non-numeric" width="160px"
83+
<th class="mdl-data-table__cell--non-numeric" width="120px"
8484
style="padding-left: 0px">
8585
<div style="display:inline"><big>Format&nbsp;</big></div>
8686
</th>

javascripts/demo.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ function demo() {
169169
if (order == 1) {
170170
names.push("Sparse");
171171
} else if (order == 2) {
172-
names.push("DCSR");
173-
names.push("CSR");
174172
names.push("COO");
173+
names.push("CSR");
174+
names.push("DCSR");
175175
} else if (order >= 3) {
176-
names.push("CSF");
177176
names.push("COO");
177+
names.push("CSF");
178178
}
179179
return names;
180180
},
@@ -233,9 +233,9 @@ function demo() {
233233
listTensorsBody += "style=\"padding: 0px\">";
234234
listTensorsBody += "<div class=\"dropdown mdl-textfield mdl-js-textfield ";
235235
listTensorsBody += "mdl-textfield--floating-label getmdl-select\" ";
236-
listTensorsBody += "style=\"width: 140px; cursor: move\">";
237-
listTensorsBody += "<input class=\"mdl-textfield__input ";
238-
listTensorsBody += "format-input\" data-toggle=\"dropdown\" id=\"";
236+
listTensorsBody += "style=\"width: 100px; cursor: move\">";
237+
listTensorsBody += "<input class=\"mdl-textfield__input\" ";
238+
listTensorsBody += "data-toggle=\"dropdown\" id=\"";
239239
listTensorsBody += formatNameId;
240240
listTensorsBody += "\" type=\"text\" readonly ";
241241
listTensorsBody += "value=\"";
@@ -276,8 +276,8 @@ function demo() {
276276
listTensorsBody += "<div class=\"dropdown mdl-textfield mdl-js-textfield ";
277277
listTensorsBody += "mdl-textfield--floating-label getmdl-select\" ";
278278
listTensorsBody += "style=\"cursor: move\">";
279-
listTensorsBody += "<input class=\"mdl-textfield__input ";
280-
listTensorsBody += "format-input\" data-toggle=\"dropdown\" id=\"";
279+
listTensorsBody += "<input class=\"mdl-textfield__input\" ";
280+
listTensorsBody += "data-toggle=\"dropdown\" id=\"";
281281
listTensorsBody += selectId;
282282
listTensorsBody += "\" type=\"text\" readonly ";
283283
listTensorsBody += "value=\"";
@@ -292,23 +292,23 @@ function demo() {
292292
listTensorsBody += "<label class=\"mdl-textfield__label\">Dimension ";
293293
listTensorsBody += (dim + 1);
294294
listTensorsBody += "</label>";
295-
listTensorsBody += "<ul class=\"dropdown-menu\" for=\""
295+
listTensorsBody += "<ul class=\"level-formats dropdown-menu\" for=\""
296296
listTensorsBody += selectId;
297297
listTensorsBody += "\"><li class =\"dense\"><a data-val=\""
298298
listTensorsBody += "d\">Dense</a></li>";
299299
listTensorsBody += "<li class=\"sparse dropdown-submenu\">";
300300
listTensorsBody += "<a>Sparse";
301301
listTensorsBody += "<i class=\"material-icons\" style=\"float:right\">";
302302
listTensorsBody += "keyboard_arrow_right</i></a>";
303-
listTensorsBody += "<ul class=\"dropdown-menu\">";
303+
listTensorsBody += "<ul class=\"level-formats dropdown-menu\">";
304304
listTensorsBody += "<li><a data-val=\"s\">Unique</a></li>";
305305
listTensorsBody += "<li><a data-val=\"u\">Not Unique</a></li>";
306306
listTensorsBody += "</ul></li>";
307307
listTensorsBody += "<li class=\"singleton dropdown-submenu\">";
308308
listTensorsBody += "<a>Singleton";
309309
listTensorsBody += "<i class=\"material-icons\" style=\"float:right\">";
310310
listTensorsBody += "keyboard_arrow_right</i></a>";
311-
listTensorsBody += "<ul class=\"dropdown-menu\">";
311+
listTensorsBody += "<ul class=\"level-formats dropdown-menu\">";
312312
listTensorsBody += "<li><a data-val=\"q\">Unique</a></li>";
313313
listTensorsBody += "<li><a data-val=\"c\">Not Unique</a></li>";
314314
listTensorsBody += "</ul></li>";
@@ -333,6 +333,9 @@ function demo() {
333333
var name = tblFormatsView.getFormatName(entry, model.input.tensorOrders[tensor]);
334334
$("#format" + tensor).val(name);
335335
tblFormatsView.insertNamesCacheEntry(tensor, name);
336+
337+
model.cancelReq();
338+
model.setOutput("", "", "", "");
336339
}
337340
});
338341

@@ -403,7 +406,10 @@ function demo() {
403406
tblFormatsView.insertLevelsCacheEntry(tensor,
404407
tblFormatsView.createEntryFromName(name, model.input.tensorOrders[tensor]));
405408
tblFormatsView.insertNamesCacheEntry(tensor, name);
409+
406410
model.updateInputViews();
411+
model.cancelReq();
412+
model.setOutput("", "", "", "");
407413
});
408414
});
409415

stylesheets/dropdown.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,26 @@
33
top: initial;
44
min-width: 10px;
55
margin: 0;
6+
}
7+
8+
.formats {
9+
width: 100px;
10+
}
11+
12+
.formats li {
13+
width: 100px;
14+
}
15+
16+
.level-formats {
617
padding-top: 0px;
718
}
819

20+
.level-formats li {
21+
width: 140px;
22+
}
23+
924
.dropdown li {
1025
float: left;
11-
width: 140px;
1226
padding: 0;
1327
font-size: 16px;
1428
}

0 commit comments

Comments
 (0)