Double click instead of click

847 views
Skip to first unread message

Jolle Carlestam

unread,
Oct 13, 2009, 5:55:10 PM10/13/09
to jquery-wee...@googlegroups.com
What would it take to make the calendar react on double clicks instead
of clicks?

Drag an area and get the New Event dialog is great. But it pops up a
little too easy from just casual clicks.
I tried to replace some mouseup and click with dblclick and got it
almost working. Part from that it still draws the blue background on a
single click. What am I missing?

HDB
Jolle

Rob Monie

unread,
Oct 13, 2009, 6:04:25 PM10/13/09
to jquery-wee...@googlegroups.com
There's a function called _setupEventCreationForWeekDay that sets up mousedown / up events for the weekday columns. If you commented this code out it would prevent the creation of events via a click / drag.

-rob

Jolle Carlestam

unread,
Oct 13, 2009, 6:12:05 PM10/13/09
to jquery-wee...@googlegroups.com
But that's quite the opposite from what I want.

I want to keep the drag behavior.
What I want to prevent is the New Event dialog to popup on a single
click. That I want to replace with a double click.

HDB
Jolle

Rob Monie

unread,
Oct 13, 2009, 6:18:46 PM10/13/09
to jquery-wee...@googlegroups.com
Ah, ok, sorry. Have a look at this area in the mouseup event of that same piece of code...

if (!$newEvent.hasClass("ui-resizable-resizing")) {
      $newEvent.css({height: options.timeslotHeight * options.defaultEventLength}).show();
}

You could prevent a click without a drag from triggering a new event of default length in here. I haven't given this a lot of thought but I think if you changed this to remove the new event and return so that it doesn't continue, you'd get the desired behaviour.

-rob

Jolle Carlestam

unread,
Oct 13, 2009, 6:44:13 PM10/13/09
to jquery-wee...@googlegroups.com
Can't really make it do as I hope. If I change stuff it breaks
behavior I want to keep.

Basically I'm trying to mimic the way it's done in my stand alone
calendar app (Ical on OSX).

If I single click in the calendar nothing happens, well it selects the
day but that's irrelevant in our case.
If I single click an existing event it activates the event but it
doesn't open the edit dialog. (Having the event activated means that I
can then delete it without opening it or copy/cut it for insertion in
another place. In a way nice features but not what I'm asking for.)
If I click and drag it creates a new event and open the event edit
dialog.
If I double click on a free space it opens the new event dialog
If I double click on an existing event it opens the edit dialog

I think this is more in line with proven interface guidelines. Having
it react on every single click makes the user nervous.

HDB
Jolle

Rob Monie

unread,
Oct 14, 2009, 6:26:15 PM10/14/09
to jquery-wee...@googlegroups.com
What you're saying makes sense. When I modelled the interations I based them on google calendar (for better or worse) which conflict with what ical does. There's an argument against using double clicks on the web as it's not so common in web apps although I'd be interested in checking into this again as I suspect it's less of an issue these days as apps have got a lot richer and the line between web and desktop is blurring.

It might be possible to make this configurable so that a developer can choose an interation model based on single or double clicks. Obviously moving to a purely double click approach would break existing implementations so it's not an option.

Jolle Carlestam

unread,
Oct 14, 2009, 6:37:37 PM10/14/09
to jquery-wee...@googlegroups.com
15 okt 2009 kl. 00.26 skrev Rob Monie:

> What you're saying makes sense. When I modelled the interations I
> based them on google calendar (for better or worse) which conflict
> with what ical does. There's an argument against using double clicks
> on the web as it's not so common in web apps although I'd be
> interested in checking into this again as I suspect it's less of an
> issue these days as apps have got a lot richer and the line between
> web and desktop is blurring.

In my opinion it's not a matter of if it's a web app or a "pure" app.
It's the intent of the action. Double clicking a link makes no sense
since there's only one possible action. Go get that page! It's like a
button. You never double click a button because there's only one thing
you can do with it. The purist idea that you don't double click on web
pages is because earlier you only had links or buttons to click on.
That's not true anymore. The interface is so much richer. And with
that comes the need for more levels of action. Single clicks, double
clicks, right clicks etc. We need them all to build a proper user
interface.

> It might be possible to make this configurable so that a developer
> can choose an interation model based on single or double clicks.
> Obviously moving to a purely double click approach would break
> existing implementations so it's not an option.

An option would be super! Put it on the list! :-)

HDB
Jolle

Reply all
Reply to author
Forward
0 new messages