Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

basic click selections

  • Loading branch information...
commit 7ca87bd5ef70a9e2b38a29fa657a880204038c0a 1 parent 186685c
@jtwb2 jtwb2 authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 static/draggies.js
View
9 static/draggies.js
@@ -76,6 +76,7 @@ $(function(){
var clientId = getNewId(),
fayeclient = new Faye.Client('/fayeclient'),
remote = new Remote(fayeclient, clientId),
+ selected = null,
boxHtml = '<div class="dg-box"></div>',
newBox = function(id, pos) {
return $(boxHtml).appendTo($('#dg-boxstart'))
@@ -92,7 +93,13 @@ $(function(){
}).css({
top: pos.top || pos.y || pos[1],
left: pos.left || pos.x || pos[0]
- }).attr('id', id);
+ }).attr('id', id)
+ .click(function(e) {
+ console.log('box click fired');
+ console.log(e.target);
+ $(selected).removeClass('dg-selected');
+ selected = $(e.target).addClass('dg-selected');
+ });
};
$(".dg-spawn").draggable({
Please sign in to comment.
Something went wrong with that request. Please try again.