Version 1
[yaffs-website] / vendor / jcalderonzumba / gastonjs / src / Browser / BrowserFrameTrait.php
diff --git a/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserFrameTrait.php b/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserFrameTrait.php
new file mode 100644 (file)
index 0000000..edefe5e
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Zumba\GastonJS\Browser;
+
+/**
+ * Trait BrowserFrameTrait
+ * @package Zumba\GastonJS\Browser
+ */
+trait BrowserFrameTrait {
+  /**
+   * Back to the parent of the iframe if possible
+   * @return mixed
+   * @throws \Zumba\GastonJS\Exception\BrowserError
+   * @throws \Exception
+   */
+  public function popFrame() {
+    return $this->command("pop_frame");
+  }
+
+  /**
+   * Goes into the iframe to do stuff
+   * @param string $name
+   * @param int    $timeout
+   * @return mixed
+   * @throws \Zumba\GastonJS\Exception\BrowserError
+   * @throws \Exception
+   */
+  public function pushFrame($name, $timeout = null) {
+    return $this->command("push_frame", $name, $timeout);
+  }
+}