Difference between revisions of "Page Action"
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
It is possible to execute an action if a content page becomes active by setting an <code>action</code> property (of type <code>string</code>) to a content page object. An action-related <code>data</code> property (of type <code>object</code>) can also be set. Please see [[Internal Actions]] for possible values. This feature is available since version '''0.1.112'''. | It is possible to execute an action if a content page becomes active by setting an <code>action</code> property (of type <code>string</code>) to a content page object. An action-related <code>data</code> property (of type <code>object</code>) can also be set. Please see [[Internal Actions]] for possible values. This feature is available since version '''0.1.112'''. | ||
− | '''Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action. Since version 0.1.30 the underlay page action is also executed if the content becomes inactive (i.e. if a corresponding menu becomes active and the content is visible).''' | + | '''Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action. Since version 0.1.30, the underlay page action is also executed if the content becomes inactive (i.e. if a corresponding menu becomes active and the content is still visible).''' |
Please see following example. | Please see following example. |
Latest revision as of 12:50, 3 March 2021
It is possible to execute an action if a content page becomes active by setting an action
property (of type string
) to a content page object. An action-related data
property (of type object
) can also be set. Please see Internal Actions for possible values. This feature is available since version 0.1.112.
Note: A page action is executed before a selection action (which is executed if a content item becomes the focus). If the content page is displayed as overlay page, the action is executed when the entire content becomes active and it is executed before a common page action. If the content page is displayed as underlay page, the action is executed when the entire content becomes visible and it is executed before an overlay page action. Since version 0.1.30, the underlay page action is also executed if the content becomes inactive (i.e. if a corresponding menu becomes active and the content is still visible).
Please see following example.
Example[edit]
Screenshot[edit]
Code[edit]
{
"type": "pages",
"headline": "Page Action",
"underlay": {
"action": "logger:debug:Content is visible."
},
"overlay": {
"action": "logger:debug:Content is active."
},
"pages": [{
"action": "info:Page 1 is active.",
"items": [{
"layout": "0,0,12,6",
"color": "msx-glass",
"headline": "Page 1"
}]
}, {
"action": "info:Page 2 is active.",
"items": [{
"layout": "0,0,12,6",
"color": "msx-glass",
"headline": "Page 2"
}]
}, {
"action": "info:Page 3 is active.",
"items": [{
"layout": "0,0,12,6",
"color": "msx-glass",
"headline": "Page 3"
}]
}]
}