Colors now can be changed

This commit is contained in:
Daniel Brunner
2016-11-30 12:02:18 +01:00
parent bb96f88823
commit 4e84c98a1b
2 changed files with 13 additions and 4 deletions
+10 -1
View File
@@ -144,14 +144,23 @@ $(document).ready(function($) {
this.id = entityId++;
this.position = new Vector2();
this.speed = new Vector2();
this.elem = $('<div>').addClass('point').appendTo('body');
var elem = this.elem = $('<div>').addClass('point').appendTo('body');
this.row = $('<tr>').appendTo('#table_entities');
this.columns = {
id: $('<td>').text(this.id).appendTo(this.row),
position: $('<td>').appendTo(this.row),
speed: $('<td>').appendTo(this.row),
color: $('<td>').appendTo(this.row),
actions: $('<td>').appendTo(this.row),
}
$('<input />')
.attr('type', 'color')
.change(function(){
console.log($(this).val());
elem.css('background-color', $(this).val());
})
.appendTo(this.columns.color)
.change();
}
};