TiddlyWiki.org

Ticket #354 (closed enhancement: fixed)

Opened 1 year ago

Last modified 4 months ago

Popup code should support nested popups

Reported by: SaqImtiaz Assigned to: SaqImtiaz
Priority: minor Milestone: 2.3.1
Component: core Version:
Severity: low Keywords:
Cc:

Description

The popup code should be refactored to support nested popups. Patch will be forthcoming.

Attachments

NestedPopups.patch (3.0 kB) - added by SaqImtiaz on 04/11/07 17:38:36.
Patch for nested popups
NestedPopupsDemo.zip (70.6 kB) - added by SaqImtiaz on 04/11/07 17:38:55.
Demo for attached patch

Change History

16/07/07 16:06:31 changed by MartinBudden

  • severity changed from undefined to low.
  • milestone set to 2.3.

04/11/07 17:38:36 changed by SaqImtiaz

  • attachment NestedPopups.patch added.

Patch for nested popups

04/11/07 17:38:55 changed by SaqImtiaz

  • attachment NestedPopupsDemo.zip added.

Demo for attached patch

04/11/07 17:54:28 changed by SaqImtiaz

  • status changed from new to assigned.

The attached patch was developed based on frequent feedback from Jeremy Ruston. Look at the NestedPopupsDemo? tiddler in the attached zip file to see the code in action. Try clicking on the different 'tags' to see the nested popups handling.

Some key features:

  • Popup.show and Popup.place now take the following optional arguments halign, valign and offset.
    • halign can be 'left' or 'right' (relative to the root). It defaults to 'left' for normal popups and 'right' for nested popups.
    • valign can be 'top' or 'bottom' (relative to the root). It defaults to 'bottom' for normal popups and 'top' for nested popups
    • offset defaults to {x:0, y:0}

So we can now specify the specific alignment of the popups relative to the root as we like, or use the defaults. All nested popups are automatically aligned like a submenu unless otherwise specified. Last but not least the offset can be used for arbitrary tweaking of the placement.

If a popup is too near the edge of the screen it is flipped over to the other side. The patched code is 100% backwards compatible.

For more details on the thought process behind this, I can forward the extensive discussion between Jeremy and myself on request.

29/11/07 16:28:45 changed by MartinBudden

  • milestone set to 2.3.1.

03/04/08 13:54:33 changed by JeremyRuston

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed, with minor modifications, in changeset:4248