Hovering away no longer stops editing of editables

fixes #21
This commit is contained in:
Ali Asaria 2011-06-23 09:29:40 -04:00
parent da38ac51ac
commit 35e4cf64af
6 changed files with 25 additions and 9 deletions

View file

@ -95,6 +95,8 @@ width: 16px; height: 16px;
overflow: hidden;
resize: none;
width: 100%;
color: #330066;
color: #666;
}

View file

@ -656,7 +656,8 @@ $.widget("ui.mouse", {
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
event.preventDefault();
//ali: fixing this http://bugs.jqueryui.com/ticket/4261
//event.preventDefault();
event.originalEvent.mouseHandled = true;
return true;
},

View file

@ -86,7 +86,7 @@ $.widget("ui.mouse", {
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
event.preventDefault();
//event.preventDefault();
event.originalEvent.mouseHandled = true;
return true;
},

View file

@ -285,16 +285,16 @@
} else if ('submit' == settings.onblur) {
input.blur(function(e) {
/* prevent double submit if submit was clicked */
//t = setTimeout(function() {
t = setTimeout(function() {
form.submit();
//}, 200);
}, 200);
});
//ali here: i hacked this in so that submit happens on mouseout too
input.mouseout(function(e) {
input.blur(function(e) {
/* prevent double submit if submit was clicked */
//t = setTimeout(function() {
t = setTimeout(function() {
form.submit();
//}, 200);
}, 200);
});
} else if ($.isFunction(settings.onblur)) {
input.blur(function(e) {

View file

@ -171,6 +171,17 @@ function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
var card = $(h);
card.appendTo('#board');
//@TODO
//Draggable has a bug which prevents blur event
//http://bugs.jqueryui.com/ticket/4261
//So we have to blur all the cards and editable areas when
//we click on a card
//The following doesn't work so we will do the bug
//fix recommended in the above bug report
// card.click( function() {
// $(this).focus();
// } );
card.draggable(
{
snap: false,

View file

@ -6,7 +6,9 @@ html(lang="en")
<script src="/socket.io/socket.io.js"></script>
<script src="/lib/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>
<!-- <script src="/lib/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script> -->
<script src="/lib/jquery-ui/development-bundle/ui/jquery-ui-1.8.9.custom.js"></script>
<script src="/lib/jquery.jeditable.js"></script>