room-controllet.html 2.67 KB
<link rel="import" href="../../bower_components/polymer/polymer.html" />

<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">

<dom-module id="room-controllet">

    <template>

        <style is="custom-style">

            .room {
                cursor: pointer;
            }

            .room-body {

            }

            .room-subject {

            }

            .room-timestamp {

            }

        </style>

        <div id={{roomId}} class="grid-item room" on-mouseover="_showTooltip">
            <div class="room-body"><span>{{body}}</span></div>
            <div class="room-subject"><span>{{subject}}</span></div>
            <div class="room-timestamp">{{timestamp}}</div>
        </div>

        <paper-dialog id="dialog_info_input">
            <h2 id="dialog_name"></h2>
            <p id="dialog_description"></p>
        </paper-dialog>

    </template>

    <script>

        Polymer({

            is : 'room-controllet',

            properties : {

                roomId : {
                    type  : Number,
                    value : undefined
                },

                roomColor : {
                    type  : String,
                    value : ""
                },

                roomHeight : {
                    type  : Number,
                    value : undefined
                },

                roomWidth : {
                    type  : Number,
                    value : undefined
                },

                body : {
                    type  : String,
                    value : ""
                },

                subject  : {
                    type  : String,
                    value : ""
                },

                timestamp : {
                    type  : String,
                    value : ""
                },

                openData : {
                    type  : Number,
                    value : undefined
                },

                comments : {
                    type  : Number,
                    value : undefined
                }

            },

            attached : function() {
                var room = document.getElementById(this.roomId);
                console.log(room);
                $(room).height(this.roomHeight);
                $(room).width(this.roomWidth);
                $(room).css('background', this.roomColor)
//                $(this.$.room).height(this.roomHeight);
//                $(this.$.room).width(this.roomWidth);
//                $(this.$.room).css('background', this.color)
            },

            _showTooltip: function() {
                console.log("weeeeeeeeeeee");
            }

        });

    </script>

</dom-module>