Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2e0e81ba

Přidáno uživatelem Martin Matas před více než 5 roky(ů)

Introduced group include/exclude support for Timeline, fixed bug with redrawing hidden nodes (refs #7562)

Zobrazit rozdíly:

sources/imiger-core/src/main/webapp/js/components/group.js
168 168
	include() {
169 169
		super.include();
170 170

  
171
        this.vertexList.forEach(vertex => {
172
            var notifyTimeline = new CustomEvent('imigerInclude', { detail: { entityID: vertex.id } });
173
            document.dispatchEvent(notifyTimeline);
174
        });
175

  
171 176
		// set edges' ends
172 177
		let inEdgeList = this.inEdgeList;
173 178
		inEdgeList.forEach(edge => {
sources/imiger-core/src/main/webapp/js/components/vertexContextMenuList.js
119 119

  
120 120
		// add the vertex to the group
121 121
		group.addVertex(this._vertex);
122
        var notifyTimeline = new CustomEvent('imigerExclude', { detail: { entityID: this._vertex.id } });
123
        document.dispatchEvent(notifyTimeline);
122 124

  
123 125
		app.viewportComponent.contextMenuComponent.close();
124 126
	}
sources/imiger-core/src/main/webapp/js/timeline/cz/kajda/data/Entity.js
81 81
        _continuous : null,
82 82
        _properties : null,
83 83
        _description : null,
84
        _visible : true,
84 85
        /**
85 86
         * @author Michal Fiala
86 87
         * Array for subEntities
......
144 145
            return this._continuous;
145 146
        },
146 147

  
148
        /**
149
         * Checks whether the entity is visible or not.
150
         * @returns {Boolean}
151
         */
152
        isVisible : function() {
153
            return this._visible;
154
        },
155

  
156
        /**
157
         * Set whether the entity is visible or not.
158
         * @param isVisible {Boolean}
159
         */
160
        setVisibility : function(isVisible) {
161
            this._visible = isVisible;
162
        },
163

  
147 164
        /**
148 165
         * Returns property value if is available.
149 166
         * Otherwise returns null.
sources/imiger-core/src/main/webapp/js/timeline/cz/kajda/timeline/Timeline.js
504 504

  
505 505
            _handleIMiGErExclude : function(e) {
506 506
                var entity = this.getEntities().get(e.originalEvent.detail.entityID);
507
                $('div[data-entity=' + entity.getId() + ']').hide();
507
                entity.setVisibility(false);
508
                this.redraw();
508 509
            },
509 510

  
510 511
            _handleIMiGErInclude : function(e) {
511 512
                var entity = this.getEntities().get(e.originalEvent.detail.entityID);
512
                $('div[data-entity=' + entity.getId() + ']').show();
513
                entity.setVisibility(true);
514
                this.redraw();
513 515
            },
514 516

  
515 517
            _handleIMiGErClick : function(e) {
sources/imiger-core/src/main/webapp/js/timeline/cz/kajda/timeline/render/BandItemRenderer.js
184 184
        /** @see cz.kajda.timeline.render.AbstractItemRenderer#render */
185 185
        render : function(item) {
186 186
            var itemWrapper = $("<div>");
187
            var element = item.getEntity().isContinuous() ? this._renderContinuous(item) : this._renderMoment(item);
188
            element.addClass(this.DURATION_CLASS);
189
            var titleEl = $("<div>")
187

  
188
            if (item.getEntity().isVisible()) {
189
                var element = item.getEntity().isContinuous() ? this._renderContinuous(item) : this._renderMoment(item);
190
                element.addClass(this.DURATION_CLASS);
191
                var titleEl = $("<div>")
190 192
                    .addClass(this.LABEL_CLASS)
191 193
                    .text(item.getEntity().getTitle());
192
            
193
            itemWrapper.append(element)
194

  
195
                itemWrapper.append(element)
194 196
                    .append(titleEl);
195
            
196
            item.setLabelElement(titleEl);
197
            item.setDurationElement(element);                
198
            
197

  
198
                item.setLabelElement(titleEl);
199
                item.setDurationElement(element);
200
            }
201

  
199 202
            return itemWrapper;
200 203
        },
201 204
        

Také k dispozici: Unified diff