Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: disable the storyview scroll in the "Open" tab #8696

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion core/modules/storyviews/classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ClassicStoryView.prototype.navigateTo = function(historyInfo) {
var listItemWidget = this.listWidget.children[listElementIndex],
targetElement = listItemWidget.findFirstDomNode();
// Abandon if the list entry isn't a DOM element (it might be a text node)
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE) {
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE || listItemWidget.getVariable("tv-disable-storyview-scroll") === "yes") {
return;
}
// Scroll the node into view
Expand Down
2 changes: 1 addition & 1 deletion core/modules/storyviews/pop.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PopStoryView.prototype.navigateTo = function(historyInfo) {
var listItemWidget = this.listWidget.children[listElementIndex],
targetElement = listItemWidget.findFirstDomNode();
// Abandon if the list entry isn't a DOM element (it might be a text node)
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE) {
if(!targetElement || targetElement.nodeType === Node.TEXT_NODE || listItemWidget.getVariable("tv-disable-storyview-scroll") === "yes") {
return;
}
// Scroll the node into view
Expand Down
4 changes: 3 additions & 1 deletion core/modules/storyviews/zoomin.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ ZoominListView.prototype.navigateTo = function(historyInfo) {
},duration);
}
// Scroll the target into view
// $tw.pageScroller.scrollIntoView(targetElement);
/* if(listItemWidget.getVariable("tv-disable-storyview-scroll") !== "yes") {
$tw.pageScroller.scrollIntoView(targetElement);
}*/
};

/*
Expand Down
2 changes: 2 additions & 0 deletions core/ui/EditTemplate/fields.tid
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<div class="tc-edit-fields">
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
<tbody>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">
<$list filter=<<config-filter>> variable="temp">
<tr class="tc-edit-field">
Expand All @@ -96,6 +97,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
</tr>
</$list>
</$list>
</$set>
</tbody>
</table>
</div>
Expand Down
18 changes: 10 additions & 8 deletions core/ui/EditTemplate/tags.tid
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ tags: $:/tags/EditTemplate

\procedure edit-tags-template(tagField:"tags")
<div class="tc-edit-tags">
<$list filter="[<currentTiddler>get<tagField>enlist-input[]sort[title]]" storyview="pop">
<$macrocall $name="tag-body"
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
palette={{$:/palette}}
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
tagField=<<tagField>>
/>
</$list>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[<currentTiddler>get<tagField>enlist-input[]sort[title]]" storyview="pop">
<$macrocall $name="tag-body"
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
palette={{$:/palette}}
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
tagField=<<tagField>>
/>
</$list>
</$set>
<$let tabIndex={{$:/config/EditTabIndex}} cancelPopups="yes">
<$macrocall $name="tag-picker" tagField=<<tagField>>/>
</$let>
Expand Down
2 changes: 2 additions & 0 deletions core/ui/Manager/ItemSidebarTags.tid
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ caption: {{$:/language/Manager/Item/Tags}}
\end

<p>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[all[current]tags[]] [list[$:/config/Manager/RecentTags]] +[sort[title]] " variable="tag" storyview="pop">
<div>
<$checkbox tiddler=<<currentTiddler>> tag=<<tag>> actions=<<tag-checkbox-actions>>>
<$macrocall $name="tag-pill" tag=<<tag>>/>
</$checkbox>
</div>
</$list>
</$set>
</p>
<p>
<$fieldmangler>
Expand Down
12 changes: 7 additions & 5 deletions core/ui/PageControls.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ title: $:/core/ui/PageTemplate/pagecontrols

<div class="tc-page-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
<$list filter="[<config-title>!text[hide]]" storyview="pop" variable="ignore">
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
<$transclude $tiddler=<<listItem>> $mode="inline"/>
</$let>
</$list>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[<config-title>!text[hide]]" storyview="pop" variable="ignore">
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
<$transclude $tiddler=<<listItem>> $mode="inline"/>
</$let>
</$list>
</$set>
</$list>
</div>
4 changes: 4 additions & 0 deletions core/ui/PageTemplate/alerts.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ tags: $:/tags/PageTemplate

<div class="tc-alerts">

<$set name="tv-disable-storyview-scroll" value="yes">

<$list filter="[all[shadows+tiddlers]tag[$:/tags/Alert]!has[draft.of]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>

</$set>

</div>
4 changes: 4 additions & 0 deletions core/ui/PageTemplate/topleftbar.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ tags: $:/tags/PageTemplate

<span class="tc-topbar tc-topbar-left">

<$set name="tv-disable-storyview-scroll" value="yes">

<$list filter="[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]" variable="listItem" storyview="pop">

<$transclude tiddler=<<listItem>> mode="inline"/>

</$list>

</$set>

</span>
4 changes: 4 additions & 0 deletions core/ui/PageTemplate/toprightbar.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ tags: $:/tags/PageTemplate

<span class="tc-topbar tc-topbar-right">

<$set name="tv-disable-storyview-scroll" value="yes">

<$list filter="[all[shadows+tiddlers]tag[$:/tags/TopRightBar]!has[draft.of]]" variable="listItem" storyview="pop">

<$transclude tiddler=<<listItem>> mode="inline"/>

</$list>

</$set>

</span>
2 changes: 2 additions & 0 deletions core/ui/SideBar/Open.tid
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ $button$
\end

<div class="tc-sidebar-tab-open">
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[list<tv-story-list>]" history=<<tv-history-list>> storyview="pop">
<div class="tc-sidebar-tab-open-item">
<$macrocall $name="droppable-item" button="<$button message='tm-close-tiddler' tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class='tc-btn-invisible tc-btn-mini tc-small-gap-right'>{{$:/core/images/close-button}}</$button><$link/>"/>
</div>
</$list>
</$set>
<$tiddler tiddler="">
<div>
<$macrocall $name="droppable-item" button="<$button message='tm-close-all-tiddlers' class='tc-btn-invisible tc-btn-mini'><<lingo Button>></$button>"/>
Expand Down
14 changes: 8 additions & 6 deletions core/ui/ViewTemplate/tags/default.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ title: $:/core/ui/ViewTemplate/tags/default

\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper">
<$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Tags]!has[draft.of]]">
<$transclude mode="inline"/>
</$list>
</div>
<div class="tc-tags-wrapper">
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Tags]!has[draft.of]]">
<$transclude mode="inline"/>
</$list>
</div>
</$reveal>
18 changes: 10 additions & 8 deletions core/ui/ViewTemplate/title.tid
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ tags: $:/tags/ViewTemplate
<div class="tc-tiddler-title tc-clearfix">
<div class="tc-titlebar">
<span class="tc-tiddler-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]"
storyview="pop"
variable="listItem"
>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
</$list>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]"
storyview="pop"
variable="listItem"
>
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
<$transclude tiddler=<<listItem>>/>
</$set>
</$list>
</$set>
</span>
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
<$link>
Expand Down
8 changes: 5 additions & 3 deletions core/wiki/macros/tabs.tid
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ code-body: yes

\define tabs-tab-list()
\whitespace trim
<$list filter=<<__tabsList__>> variable="currentTab" storyview="pop">
<<tabs-tab>>
</$list>
<$set name="tv-disable-storyview-scroll" value="yes">
<$list filter=<<__tabsList__>> variable="currentTab" storyview="pop">
<<tabs-tab>>
</$list>
</$set>
\end

\define tabs-tab-body()
Expand Down
Loading