Ticket #301: ticket301.patch
| File ticket301.patch, 3.1 KB (added by UdoBorkowski, 5 years ago) |
|---|
-
js/Commands.js
4 4 5 5 config.commands.closeTiddler.handler = function(event,src,title) 6 6 { 7 story.closeTiddler(title,true,event.shiftKey || event.altKey );7 story.closeTiddler(title,true,event.shiftKey || event.altKey,true); 8 8 return false; 9 9 }; 10 10 11 11 config.commands.closeOthers.handler = function(event,src,title) 12 12 { 13 story.closeAllTiddlers(title );13 story.closeAllTiddlers(title,true); 14 14 return false; 15 15 }; 16 16 -
js/Macros.js
253 253 254 254 config.macros.closeAll.onClick = function(e) 255 255 { 256 story.closeAllTiddlers( );256 story.closeAllTiddlers(null,true); 257 257 return false; 258 258 }; 259 259 -
js/Story.js
398 398 //# title - name of tiddler to close 399 399 //# animate - whether to perform animations 400 400 //# slowly - whether to perform animations in slomo 401 Story.prototype.closeTiddler = function(title,animate,slowly) 401 //# allowAsync - when true closing the tiddler will occur asynchronously (i.e. possibly after this function returned). (Pass true here as often as possible as it gets rid of the problem described in ticket #301) 402 Story.prototype.closeTiddler = function(title,animate,slowly,allowAsync) 402 403 { 403 404 var tiddlerElem = document.getElementById(this.idPrefix + title); 404 405 if(tiddlerElem != null) { … … 406 407 this.scrubTiddler(tiddlerElem); 407 408 if(config.options.chkAnimate && animate && anim && typeof Slider == "function") 408 409 anim.startAnimating(new Slider(tiddlerElem,false,slowly,"all")); 409 else 410 tiddlerElem.parentNode.removeChild(tiddlerElem); 410 else { 411 //# bugfox for ticket #301: set overflow=hidden and use asynch redraw (if allowed) 412 tiddlerElem.style.overflow = "hidden"; 413 if (allowAsync) 414 setTimeout(function(){tiddlerElem.parentNode.removeChild(tiddlerElem)},0); 415 else 416 tiddlerElem.parentNode.removeChild(tiddlerElem); 417 } 411 418 } 412 } ;419 } 413 420 414 421 //# Scrub IDs from a tiddler. This is so that the 'ghost' of a tiddler while it is being closed 415 422 //# does not interfere with things … … 450 457 }; 451 458 452 459 //# Close all tiddlers in the story 453 Story.prototype.closeAllTiddlers = function(exclude) 460 //# exclude - title of tiddler that should not be closed (i.e. the "close others" case) 461 //# allowAsync - when true closing the tiddler will occur asynchronously (i.e. possibly after this function returned). (Pass true here as often as possible as it gets rid of the problem described in ticket #301) 462 Story.prototype.closeAllTiddlers = function(exclude,allowAsync) 454 463 { 455 464 clearMessage(); 456 465 this.forEachTiddler(function(title,element) { 457 466 if((title != exclude) && element.getAttribute("dirty") != "true") 458 this.closeTiddler(title );459 });467 this.closeTiddler(title,false,false,allowAsync); 468 }); 460 469 window.scrollTo(0,ensureVisible(this.container)); 461 470 }; 462 471
