List watchers will now scroll.

This commit is contained in:
Scimonster 2013-10-30 21:47:46 +02:00
parent 8934e1e577
commit 78220904e2
2 changed files with 17 additions and 11 deletions

View file

@ -139,7 +139,7 @@ var List = function(data) {
List.prototype.attach = function(scene) {
this.el = $('<div class="list">');
this.el.append('<div class="list-title">'+this.listName);
this.containerEl = $('<div style="width:99%">').appendTo(this.el);
this.containerEl = $('<div style="width:99%;overflow:auto">').appendTo(this.el);
this.el.append('<div class="list-add">+');
this.el.append('<div class="list-length">length: '+this.contents.length);
scene.append(this.el);
@ -160,6 +160,7 @@ List.prototype.update = function(){
this.contents.forEach(function(val,i){
$('<div style="clear:both">').appendTo(c).append('<div class="list-index">'+(i+1),'<div class="list-item">'+val);
});
c.height(this.height-26);
this.el.find('.list-length').text('length: '+this.contents.length);
};

View file

@ -140,23 +140,28 @@
}
.list .list-add {
clear: both;
background-color: #dedede;
width: 12px;
height: 12px;
border-radius: 12px;
margin-top: 12px;
color: #707070;
font: bold 10px Verdana, sans-serif;
text-align: center;
clear: both;
background-color: #dedede;
width: 12px;
height: 12px;
border-radius: 12px;
color: #707070;
font: bold 10px Verdana, sans-serif;
text-align: center;
position: absolute;
bottom: 2px;
left: 2px;
}
.list .list-length {
font-size: 10px;
font-weight: normal;
margin-top: -12px;
text-align: center;
color: black;
position: absolute;
bottom: 2px;
left: 0px;
right: 0px;
}
/* Say/think bubble styles */