public
Description: Click-draggable. Range-makeable. A better calendar.
Homepage: http://stephencelis.com/projects/timeframe
Clone URL: git://github.com/stephencelis/timeframe.git
Click here to lend your support to: timeframe and make a donation at www.pledgie.com !
Opera fixes.
stephencelis (author)
Sun Apr 27 13:25:15 -0700 2008
commit  d5ddd3651fef7972e2d7c69dcdabdac4a81fcd17
tree    e9184e086b4a96acb94b8501340c31b861b30549
parent  850ac4728c9f142674c6a4748b2ff1e4ff8c074f
0
...
7
8
9
10
11
12
13
14
...
7
8
9
 
 
10
11
12
0
@@ -7,8 +7,6 @@ THINGS TODO (mostly in order of importance)
0
 * Limit the previous/next buttons to selectable months (between `earliest`
0
   and `latest`)
0
 
0
-* Opera, please disable your text selection
0
-
0
 * Elegant way to drag to months before and after the displayed calendars
0
 
0
 * Internationalization
...
190
191
192
 
193
194
195
...
388
389
390
 
 
 
 
 
391
392
393
...
400
401
402
 
 
 
 
403
404
405
...
190
191
192
193
194
195
196
...
389
390
391
392
393
394
395
396
397
398
399
...
406
407
408
409
410
411
412
413
414
415
0
@@ -190,6 +190,7 @@ var Timeframe = Class.create({
0
     document.observe('mouseover', this.handleMouseover.bind(this));
0
     document.observe('mouseup', this.setPoint.bind(this));
0
     document.observe('unload', this.deactivate.bind(this));
0
+ if(Prototype.Browser.Opera) document.observe('mousemove', this.handleMousemove.bind(this));
0
     this.aimFieldObservers();
0
   },
0
   
0
@@ -388,6 +389,11 @@ var Timeframe = Class.create({
0
         if(this.enddate.toString() == day.date) rangeClass += 'end';
0
         if(rangeClass.length > 0) day.addClassName(rangeClass + 'range');
0
       }
0
+ // Trick Opera into refreshing the selection (FIXME)
0
+ if(Prototype.Browser.Opera) {
0
+ day.unselectable = 'on';
0
+ day.unselectable = null;
0
+ }
0
     }.bind(this));
0
     if(this.dragging) this.refreshFields();
0
   },
0
@@ -400,6 +406,10 @@ var Timeframe = Class.create({
0
     this.startfield.removeClassName('error');
0
     this.endfield.removeClassName('error');
0
     if(field && field.value == '' && attempt != '') field.addClassName('error');
0
+ },
0
+
0
+ handleMousemove: function(event) {
0
+ if(event.findElement('#' + this.container.id + ' td')) window.getSelection().removeAllRanges();
0
   }
0
 });
0
 

Comments

    No one has commented yet.