[xmosaicframe] add a button to remove a frame (closes #289628)

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changeset81f2912eef8e
branchdefault
phasedraft
hiddenyes
parent revision#31c12b7e2c6c [xmosaicframe] small refactoring: use an alias for root.querySelector
child revision#a619fff3560c add a button to fold/unfold frame (closes #289629)
files modified by this revision
components/xmosaicframe/xmosaicframe.es6
components/xmosaicframe/xmosaicframe.html
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1427453191 -3600
# Fri Mar 27 11:46:31 2015 +0100
# Node ID 81f2912eef8ee9bc53d84846b8a0c7be3e1d911d
# Parent 31c12b7e2c6cd491a79297477c7656d4c735d326
[xmosaicframe] add a button to remove a frame (closes #289628)

diff --git a/components/xmosaicframe/xmosaicframe.es6 b/components/xmosaicframe/xmosaicframe.es6
@@ -22,10 +22,13 @@
1              qs('#panel').style.display = 'block';
2              qs('form').style.display = 'none';
3              queryUpdated(host, ownerDocument, registry);
4              e.preventDefault();
5          });
6 +        qs('#remove-frame').addEventListener('click', function(e) {
7 +            host.remove();
8 +        });
9      }
10 
11 
12      function queryUpdated(host, ownerDocument, registry) {
13          let sourceviews = registry.views[host.dataset.source],
diff --git a/components/xmosaicframe/xmosaicframe.html b/components/xmosaicframe/xmosaicframe.html
@@ -36,10 +36,11 @@
14  		aria-expanded="false">View <span class="caret"></span>
15  	</button>
16  	<ul id="view-menu" class="dropdown-menu" role="menu">
17  	</ul>
18        </div>
19 +      <button id="remove-frame" class="btn btn-default glyphicon glyphicon-remove"></button>
20      </div>
21      <div class="panel-body">
22      </div>
23    </div>
24  </template>