mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
Better display for tags in document list
This commit is contained in:
parent
395b528b4b
commit
1deda6e993
@ -45,6 +45,7 @@
|
||||
<script src="js/service/User.js" type="text/javascript"></script>
|
||||
<script src="js/service/Tag.js" type="text/javascript"></script>
|
||||
<script src="js/filter/Newline.js" type="text/javascript"></script>
|
||||
<script src="js/filter/Shorten.js" type="text/javascript"></script>
|
||||
<script src="js/directive/File.js" type="text/javascript"></script>
|
||||
<script src="js/directive/SelectTag.js" type="text/javascript"></script>
|
||||
<script src="js/directive/InlineEdit.js" type="text/javascript"></script>
|
||||
|
13
docs-web/src/main/webapp/js/filter/Shorten.js
Normal file
13
docs-web/src/main/webapp/js/filter/Shorten.js
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Filter shortening text in one letter uppercase.
|
||||
*/
|
||||
App.filter('shorten', function() {
|
||||
return function(text) {
|
||||
if (!text) {
|
||||
return '';
|
||||
}
|
||||
return text.substring(0, 1).toUpperCase();
|
||||
}
|
||||
})
|
@ -49,7 +49,9 @@
|
||||
<td>{{ document.title }}</td>
|
||||
<td>{{ document.create_date | date: 'yyyy-MM-dd' }}</td>
|
||||
<td class="hidden-phone cell-tags">
|
||||
<span class="label label-info" ng-repeat="tag in document.tags">{{ tag.name }}</span>
|
||||
<div class="tags">
|
||||
<span class="label label-info" ng-repeat="tag in document.tags"><span class="shorten">{{ tag.name | shorten }}</span><span class="full">{{ tag.name }}</span></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -18,6 +18,27 @@
|
||||
|
||||
.label {
|
||||
margin-left: 2px;
|
||||
|
||||
.full {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.tags {
|
||||
position: absolute;
|
||||
margin-top: -10px;
|
||||
|
||||
.label {
|
||||
.full {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.shorten {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user