Add a close all tiddlers button

For @pmario
print-window-tiddler
Jeremy Ruston 2013-04-27 16:35:59 +01:00
rodzic 059a36b23d
commit b305debf97
3 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -36,6 +36,7 @@ NavigatorWidget.prototype.generate = function() {
{name: "tw-save-tiddler", handlerObject: this, handlerMethod: "handleSaveTiddlerEvent"}, {name: "tw-save-tiddler", handlerObject: this, handlerMethod: "handleSaveTiddlerEvent"},
{name: "tw-cancel-tiddler", handlerObject: this, handlerMethod: "handleCancelTiddlerEvent"}, {name: "tw-cancel-tiddler", handlerObject: this, handlerMethod: "handleCancelTiddlerEvent"},
{name: "tw-close-tiddler", handlerObject: this, handlerMethod: "handleCloseTiddlerEvent"}, {name: "tw-close-tiddler", handlerObject: this, handlerMethod: "handleCloseTiddlerEvent"},
{name: "tw-close-all-tiddlers", handlerObject: this, handlerMethod: "handleCloseAllTiddlersEvent"},
{name: "tw-new-tiddler", handlerObject: this, handlerMethod: "handleNewTiddlerEvent"} {name: "tw-new-tiddler", handlerObject: this, handlerMethod: "handleNewTiddlerEvent"}
]; ];
}; };
@ -114,6 +115,14 @@ NavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {
return false; return false;
}; };
// Close all tiddlers
NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {
this.storyList = [];
this.saveStoryList();
event.stopPropagation();
return false;
};
// Place a tiddler in edit mode // Place a tiddler in edit mode
NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) { NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
this.getStoryList(); this.getStoryList();

Wyświetl plik

@ -195,11 +195,11 @@ a.tw-tiddlylink-missing {
border: none; border: none;
} }
.tw-menu-list-item .btn-mini-close { .btn-mini {
color: #e0e0e0; color: #e0e0e0;
} }
.tw-menu-list-item:hover .btn-mini-close { .btn-mini:hover {
color: #444; color: #444;
} }

Wyświetl plik

@ -26,8 +26,9 @@ title: $:/templates/SideBar
<div class="tw-tab-content"> <div class="tw-tab-content">
<$reveal type="match" state="$:/state/sideBarTabSet" text="openTab" qualifyTiddlerTitles="yes"> <$reveal type="match" state="$:/state/sideBarTabSet" text="openTab" qualifyTiddlerTitles="yes">
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" itemClass="tw-menu-list-item"> <$list filter="[list[$:/StoryList]]" history="$:/HistoryList" itemClass="tw-menu-list-item">
<$button message="tw-close-tiddler" class="btn-invisible btn-mini-close">&times;</$button> <$view field="title" format="link"/> <$button message="tw-close-tiddler" class="btn-invisible btn-mini">&times;</$button> <$view field="title" format="link"/>
</$list> </$list>
<$button message="tw-close-all-tiddlers" class="btn-invisible btn-mini">close all</$button>
</$reveal> </$reveal>
<$reveal type="match" state="$:/state/sideBarTabSet" text="allTab" qualifyTiddlerTitles="yes"> <$reveal type="match" state="$:/state/sideBarTabSet" text="allTab" qualifyTiddlerTitles="yes">
<$list filter="[!is[system]sort[title]]" itemClass="tw-menu-list-item"/> <$list filter="[!is[system]sort[title]]" itemClass="tw-menu-list-item"/>