diff --git a/core/images/close-others-button.tid b/core/images/close-others-button.tid new file mode 100644 index 000000000..e9f24f304 --- /dev/null +++ b/core/images/close-others-button.tid @@ -0,0 +1,23 @@ +title: $:/core/images/close-others-button + + + + + + + + diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index cd1276a16..f003059ac 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -24,6 +24,7 @@ var NavigatorWidget = function(parseTreeNode,options) { {type: "tw-cancel-tiddler", handler: "handleCancelTiddlerEvent"}, {type: "tw-close-tiddler", handler: "handleCloseTiddlerEvent"}, {type: "tw-close-all-tiddlers", handler: "handleCloseAllTiddlersEvent"}, + {type: "tw-close-all-other-tiddlers", handler: "handleCloseAllOtherTiddlersEvent"}, {type: "tw-new-tiddler", handler: "handleNewTiddlerEvent"}, {type: "tw-import-tiddlers", handler: "handleImportTiddlersEvent"}, ]); @@ -134,6 +135,12 @@ NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) { this.saveStoryList(); return false; }; +// Close all other tiddlers +NavigatorWidget.prototype.handleCloseAllOtherTiddlersEvent = function(event) { + this.storyList = [event.tiddlerTitle]; + this.saveStoryList(); + return false; +}; // Place a tiddler in edit mode NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {