Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Commit

Permalink
EXOGTN-1590: [Edit-Inplace] Implement deleting window
Browse files Browse the repository at this point in the history
  • Loading branch information
haint authored and vietj committed Oct 26, 2013
1 parent 934d675 commit 5e8c1c0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 13 deletions.
Expand Up @@ -2,7 +2,9 @@
<div id="1" class="span12 sortable <%=l1==null || l1.isEmpty() ? 'emptyContainer' : '' %>" >
<% l1.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand Down
Expand Up @@ -2,7 +2,9 @@
<div id="3" class="span12 sortable <%=l3==null || l3.isEmpty() ? 'emptyContainer' : '' %>">
<% l3.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand All @@ -12,15 +14,19 @@
<div id="1" class="span6 sortable <%=l1==null || l1.isEmpty() ? 'emptyContainer' : '' %>">
<% l1.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
</div>
<div id="2" class="span6 sortable <%=l2==null || l2.isEmpty() ? 'emptyContainer' : '' %>">
<% l2.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand Down
Expand Up @@ -2,15 +2,19 @@
<div id="1" class="span6 sortable <%=l1==null || l1.isEmpty() ? 'emptyContainer' : '' %>">
<% l1.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
</div>
<div id="2" class="span6 sortable <%=l2==null || l2.isEmpty() ? 'emptyContainer' : '' %>">
<% l2.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand All @@ -20,7 +24,9 @@
<div id="3" class="span12 sortable <%=l3==null || l3.isEmpty() ? 'emptyContainer' : '' %>">
<% l3.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand Down
Expand Up @@ -2,15 +2,19 @@
<div id="1" class="span3 sortable <%=l1==null || l1.isEmpty() ? 'emptyContainer' : '' %>">
<% l1.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
</div>
<div id="2" class="span9 sortable <%=l2==null || l2.isEmpty() ? 'emptyContainer' : '' %>">
<% l2.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand Down
Expand Up @@ -2,23 +2,29 @@
<div id="1" class="span4 sortable <%=l1==null || l1.isEmpty() ? 'emptyContainer' : '' %>">
<% l1.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
</div>
<div id="2" class="span4 sortable <%=l2==null || l2.isEmpty() ? 'emptyContainer' : '' %>">
<% l2.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
</div>
<div id="3" class="span4 sortable <%=l3==null || l3.isEmpty() ? 'emptyContainer' : '' %>">
<% l3.each { name, fragment -> %>
<div id="${name}" class="portlet">
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}</h3>
<h3 style="${cursor}" title="${tooltip}">${icon} ${fragment.title}
<% if (editing) { %><button class="close" type="button">x</button> <% } %>
</h3>
<div>${fragment.content}</div>
</div>
<% } %>
Expand Down
Expand Up @@ -3,7 +3,8 @@
el : '.editing',

events : {
"click a.switch" : "switchLayout"
"click a.switch" : "switchLayout",
"click button.close" : "deleteApp"
},

initialize : function() {
Expand Down Expand Up @@ -66,6 +67,13 @@
}
},

deleteApp : function(e) {
var appId = $(e.target).closest('div.portlet').attr('id');
var containerId = $(e.target).closest('div.sortable').attr('id')
var container = this.model.getDescendant(containerId);
container.removeChild(appId);
},

switchLayout : function(e) {
var anchor = e.target;
var href = $(anchor).attr('href');
Expand Down

0 comments on commit 5e8c1c0

Please sign in to comment.