Navigation.TARGET
- A static object of Navigation
that alters where the contents of a navigation should be placed relative to the target
element element for .navigate()
.
+ A static object of Navigation
that alters where the contents of a navigation should be placed relative to the target
element element for .navigate()
.
= VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/target/description") ?>
@@ -12,24 +12,24 @@
TOP
- The inner DOM of the target
element will be replaced with the contents of href
from a Navigation
instance.
+ The inner DOM of the target
element will be replaced with the contents of href
from a Navigation
instance.
This is the default behavior when the vv-shell
element (top navigation) is navigated.
- Setting this parameter on a target
element that isn't the vv-shell
element has the same effect as a normal top navigation. The target is "ignored".
+ Setting this parameter on a target
element that isn't the vv-shell
element has the same effect as a normal top navigation. The target is "ignored".
SELF
- The contents of the target
element will be navigated.
+ The contents of the target
element will be navigated.
This is the default behavior when an element that isn't the vv-shell
is navigated.
- Setting this parameter on a target
element that is the vv-shell
(top navigation) has the same effect as TOP
.
+ Setting this parameter on a target
element that is the vv-shell
(top navigation) has the same effect as TOP
.
BLANK
- Performs the browser-default behavior for opening links in a new window. The target
element is ignored.
+ Performs the browser-default behavior for opening links in a new window. The target
element is ignored.
PARENT
- The closest HTMLElement
to the target
element with a vv-page
property present will be navigated. If no parent element with that attribute is found, the vv-shell
element (top navigation) will be navigated.
- Setting this parameter on a target
element that is the vv-shell
(top navigation) has the same effect as TOP
.
+ The closest HTMLElement
to the target
element with a vv-page
property present will be navigated. If no parent element with that attribute is found, the vv-shell
element (top navigation) will be navigated.
+ Setting this parameter on a target
element that is the vv-shell
(top navigation) has the same effect as TOP
.
diff --git a/public/docs/v3.1.4/Reference/JavaScript/bindElements.php b/public/docs/v3.1.4/Reference/JavaScript/bindElements.php
index b12d098..1b9d825 100644
--- a/public/docs/v3.1.4/Reference/JavaScript/bindElements.php
+++ b/public/docs/v3.1.4/Reference/JavaScript/bindElements.php
@@ -1,52 +1,22 @@
= VV::include("public/docs/v3.1.4/Reference/layout") ?>
- VV::embed()
- Inline the contents of any file.
- This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.
+ Navigation.bindElements()
+ Static method on the Navigation
class.
+ Calling this method will trigger an automatic binding of anchor tags that haven't been bound yet.
+ SSR anchor tags are automatically bound. This method should be called after you've added anchor tags dynamically with JavaScript.
- = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/PHP/VV/embed/description") ?>
-
-
-
- string
- $pathname
- Path to an asset to inline.
-
-
- bool
- $relative
- Flag which when set to:
-
- -
-
true
- Will make $pathname
look for a file relative to root_path
.
-
- -
-
false
- Will make $pathname
look for a file relative to the root of the whole filesystem.
-
-
-
-
-
- string
- Returns the contents of a file passed to $pathname
as a string. If a file can not be found at $pathname
, an empty string is returned.
+ = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/bindElements/description") ?>
- Inlining an SVG icon
- In this example we will be inlining an SVG icon from /public/assets/icon.svg
directly into our page as if it were hardcoded.
+ Binding an anchor tag added programmatically
- = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/PHP/VV/embed/example_import") ?>
+ = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/bindElements/example_bind") ?>
\ No newline at end of file
diff --git a/public/docs/v3.1.4/Reference/JavaScript/constructor.php b/public/docs/v3.1.4/Reference/JavaScript/constructor.php
index 4aba39b..dba195f 100644
--- a/public/docs/v3.1.4/Reference/JavaScript/constructor.php
+++ b/public/docs/v3.1.4/Reference/JavaScript/constructor.php
@@ -12,7 +12,7 @@
Navigation
- Returns an instance of Navigation
which can then be excuted by chaining .navigate()
.
+ Returns an instance of Navigation
which can then be excuted by chaining .navigate()
.
diff --git a/public/docs/v3.1.4/Reference/JavaScript/index.php b/public/docs/v3.1.4/Reference/JavaScript/index.php
index 7f786b2..a0d90a3 100644
--- a/public/docs/v3.1.4/Reference/JavaScript/index.php
+++ b/public/docs/v3.1.4/Reference/JavaScript/index.php
@@ -4,7 +4,7 @@
JavaScript Reference
Vegvisir will automatically find and bind HTMLAnchorElement
tags and perform soft-navigation between pages on the same origin.
- The Navigation
lets you interact with, and expand Vegvisirs front-end behavior.
+ The Navigation
lets you interact with, and expand Vegvisirs front-end behavior.
\ No newline at end of file
diff --git a/public/docs/v3.1.4/Reference/JavaScript/navigate.php b/public/docs/v3.1.4/Reference/JavaScript/navigate.php
index b12d098..7c80fe0 100644
--- a/public/docs/v3.1.4/Reference/JavaScript/navigate.php
+++ b/public/docs/v3.1.4/Reference/JavaScript/navigate.php
@@ -1,52 +1,55 @@
= VV::include("public/docs/v3.1.4/Reference/layout") ?>
- VV::embed()
- Inline the contents of any file.
- This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.
+ .navigate()
+
- = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/PHP/VV/embed/description") ?>
+ = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/navigate/description") ?>
- string
- $pathname
- Path to an asset to inline.
+ HTMLElement
| String
| null
+ target
+ An element passed either by reference or a CSS selector passed as a string (if multiple elements match the selector; the first match will be navigated).
+ If null or no value is passed to this argument, the vv-shell
element will be navigated (top navigation).
- bool
- $relative
- Flag which when set to:
-
- -
-
true
- Will make $pathname
look for a file relative to root_path
.
-
- -
-
false
- Will make $pathname
look for a file relative to the root of the whole filesystem.
-
-
+ String
+ position
+ A Navigation.POSITION string which will determine where content from the navigated page should be injected relative to target
.
+
+
+ String
+ mode
+ A Navigation.MODE string which will determine how content from the navigated page should be injected relative to target
.
- string
- Returns the contents of a file passed to $pathname
as a string. If a file can not be found at $pathname
, an empty string is returned.
+ Promise
+ Returns a Promise that will resolve when the navigated page has been injected sucessfully, or rejects if the navigation failed or if the navigation was aborted with Navigation.abort
- Inlining an SVG icon
- In this example we will be inlining an SVG icon from /public/assets/icon.svg
directly into our page as if it were hardcoded.
+ Top navigation
+ Navigate the vv-shell
element to another page (top navigation).
+ Remember that anchor tags with href's on the same origin are automatically navigated this way.
- = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/PHP/VV/embed/example_import") ?>
+ = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/navigate/example_shell_navigate") ?>
+
+
+ Navigating an element
+ Simple programmatic navigation of an element.
+
+
+ = VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.4/JS/navigate/example_element_navigate") ?>
\ No newline at end of file
diff --git a/public/docs/v3.1.4/Reference/JavaScript/options.php b/public/docs/v3.1.4/Reference/JavaScript/options.php
index ec8e64c..e03b032 100644
--- a/public/docs/v3.1.4/Reference/JavaScript/options.php
+++ b/public/docs/v3.1.4/Reference/JavaScript/options.php
@@ -2,7 +2,7 @@