Add color to selected Rohrfarbe!
This commit is contained in:
@@ -15,6 +15,24 @@
|
||||
<script type="text/javascript">
|
||||
$('#wfitem_<?=$item->name?>_<?=$building->id?>').change(function() {
|
||||
var color = $('#wfitem_<?=$item->name?>_<?=$building->id?> option:selected').data("bg-color");
|
||||
//console.log(color);
|
||||
var name = $('#wfitem_<?=$item->name?>_<?=$building->id?> option:selected').val();
|
||||
$("wfitem_<?=$item->name?>_<?=$building->id?>").data("style", "btn-danger");
|
||||
console.log("button [data-id='wfitem_<?=$item->name?>_<?=$building->id?>']");
|
||||
console.log($("button [data-id='wfitem_<?=$item->name?>_<?=$building->id?>']"));
|
||||
|
||||
var matches;
|
||||
if(matches = name.match(/^(.+)-1R$/)) {
|
||||
name = matches[1];
|
||||
}
|
||||
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$building->id?>']").removeClass(function (index, className) {
|
||||
console.log(className);
|
||||
return (className.match (/(^|\s)btn-outline-\S+/g) || []).join(' ');
|
||||
});
|
||||
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$building->id?>']").addClass("btn-outline-" + name)
|
||||
|
||||
console.log(color);
|
||||
console.log(name);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user