diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 000000000..a5808254d
--- /dev/null
+++ b/.browserslistrc
@@ -0,0 +1,7 @@
+# Browsers that we support
+
+last 2 Chrome versions
+last 2 Firefox versions
+last 2 Safari versions
+last 2 Edge versions
+ie >= 10
diff --git a/.codeclimate.yml b/.codeclimate.yml
new file mode 100644
index 000000000..1210135ae
--- /dev/null
+++ b/.codeclimate.yml
@@ -0,0 +1,22 @@
+version: "2"
+checks:
+ argument-count:
+ config:
+ threshold: 10
+ method-count:
+ config:
+ threshold: 25
+ method-lines:
+ config:
+ threshold: 30
+exclude_patterns:
+ - "demo/"
+ - "dist/"
+ - "docs/"
+ - "examples/"
+ - "jsdoc-template/"
+ - "**/node_modules/"
+ - "**/test/"
+ - "**/tests/"
+ - "**/vendor/"
+ - "babel.config.js"
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..887dd3ab4
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,4 @@
+/coverage/
+/dist/
+/docs/
+/examples/
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 000000000..0ae1e8d0f
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,40 @@
+module.exports = {
+ root: true,
+ parserOptions: {
+ ecmaVersion: 2020,
+ sourceType: 'module'
+ },
+ extends: [
+ 'eslint:recommended'
+ ],
+ env: {
+ browser: true,
+ es6: true
+ },
+ rules: {
+ 'complexity': ['warn', 6],
+ 'max-lines': ['warn', { max: 250, skipBlankLines: true, skipComments: true }],
+ 'no-console': 'off',
+ 'no-unused-vars': 'off',
+ 'prefer-const': 'off'
+ },
+ overrides: [
+ // node files
+ {
+ files: [
+ '.eslintrc.js',
+ 'babel.config.js',
+ 'jest.config.js',
+ 'rollup.config.js',
+ '__mocks__/styleMock.js'
+ ],
+ parserOptions: {
+ sourceType: 'module',
+ ecmaVersion: 2020
+ },
+ env: {
+ node: true
+ }
+ }
+ ]
+};
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..52af1484b
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+version: 2
+updates:
+- package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: weekly
+ time: "10:00"
+ open-pull-requests-limit: 10
+ labels:
+ - dependencies
+ versioning-strategy: increase
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 000000000..3e9eae2b7
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,49 @@
+
+name: CI Build
+
+on:
+ pull_request: {}
+ push:
+ branches:
+ - master
+ tags:
+ - v*
+
+jobs:
+ test:
+ name: Tests
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 10
+ - name: Install Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: pnpm
+ - name: Install dependencies
+ run: pnpm i
+ - name: Cache Cypress binary
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/Cypress
+ key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
+ restore-keys: |
+ cypress-${{ runner.os }}-
+ - name: Install Cypress binary
+ run: pnpm exec cypress install
+ - run: pnpm test
+
+ automerge:
+ needs: [test]
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ contents: write
+ steps:
+ - uses: fastify/github-action-merge-dependabot@v3.2.0
+ with:
+ github-token: ${{secrets.GITHUB_TOKEN}}
diff --git a/.github/workflows/plan-release.yml b/.github/workflows/plan-release.yml
new file mode 100644
index 000000000..e50a34eff
--- /dev/null
+++ b/.github/workflows/plan-release.yml
@@ -0,0 +1,61 @@
+name: Plan Release
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ - master
+ pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
+ types:
+ - labeled
+ - unlabeled
+
+concurrency:
+ group: plan-release # only the latest one of these should ever be running
+ cancel-in-progress: true
+
+jobs:
+ should-run-release-plan-prepare:
+ name: Should we run release-plan prepare?
+ runs-on: ubuntu-latest
+ outputs:
+ should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
+ steps:
+ - uses: release-plan/actions/should-prepare-release@v1
+ with:
+ ref: 'master'
+ id: should-prepare
+
+ create-prepare-release-pr:
+ name: Create Prepare Release PR
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ needs: should-run-release-plan-prepare
+ permissions:
+ contents: write
+ issues: read
+ pull-requests: write
+ if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
+ steps:
+ - uses: release-plan/actions/prepare@v1
+ name: Run release-plan prepare
+ with:
+ ref: 'master'
+ env:
+ GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
+ id: explanation
+
+ - uses: peter-evans/create-pull-request@v7
+ name: Create Prepare Release PR
+ with:
+ commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
+ labels: "internal"
+ sign-commits: true
+ branch: release-preview
+ title: Prepare Release ${{ steps.explanation.outputs.new-version }}
+ body: |
+ This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR đ
+
+ -----------------------------------------
+
+ ${{ steps.explanation.outputs.text }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 000000000..269ed494f
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,43 @@
+# For every push to the primary branch with .release-plan.json modified,
+# runs release-plan.
+
+name: Publish Stable
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ - master
+ paths:
+ - '.release-plan.json'
+
+concurrency:
+ group: publish-${{ github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ publish:
+ name: "NPM Publish"
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ id-token: write
+ attestations: write
+
+ steps:
+ - uses: actions/checkout@v5
+ - uses: pnpm/action-setup@v4
+ with:
+ version: 10
+ - uses: actions/setup-node@v6
+ with:
+ node-version: 20
+ registry-url: 'https://registry.npmjs.org'
+ cache: pnpm
+ - run: pnpm install --frozen-lockfile
+ - run: npm install -g npm@latest # ensure that the globally installed npm is new enough to support OIDC
+ - name: Publish to NPM
+ run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
+ env:
+ GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
index aa0d0369c..43e31c448 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,17 @@
-.sass-cache
-node_modules/
-deps/
-.DS_Store
+# Editors
+/.idea/
+/.vscode/
+
+/.log/
+/.nyc_output/
+/coverage/
+/cypress/
+/docs/
+/dist/
+/node_modules/
+/test/unit/dist
+/.DS_Store
+/.sass-cache
+/npm-debug.log*
+/stats.html
+/yarn-error.log
diff --git a/.hsdoc b/.hsdoc
index 847df1dd3..db9948d8c 100644
--- a/.hsdoc
+++ b/.hsdoc
@@ -1,6 +1,6 @@
name: "Tether"
description: "Marrying DOM elements for life"
-domain: "tether.io"
-source: "coffee/*.coffee"
+domain: "tetherjs.dev"
+source: "src/**/*.js"
examples: "**/*.md"
assets: "{dist/js/*.js,dist/css/*.css,docs/css/*.css,docs/js/*,js,docs/welcome/*,examples/*}"
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 000000000..9b4b31137
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,29 @@
+.idea/
+.vscode/
+
+coverage/
+cypress/
+docs/
+examples/
+esdoc/
+jsdoc-template/
+test/
+tests/
+
+.codeclimate.yml
+.eslintignore
+.eslintrc.js
+.gitignore
+.hsdoc
+.stylelintrc.js
+.travis.yml
+babel.config.js
+cypress.json
+index.html
+pnpm-lock.yaml
+rollup.config.js
+yarn.lock
+yarn-error.log
+
+CONTRIBUTING.md
+HISTORY.md
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 000000000..5fca0d518
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+scripts-prepend-node-path=true
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 000000000..06108151b
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,6 @@
+'use strict';
+
+module.exports = {
+ singleQuote: true,
+ trailingComma: 'none'
+};
\ No newline at end of file
diff --git a/.release-plan.json b/.release-plan.json
new file mode 100644
index 000000000..4f70eb586
--- /dev/null
+++ b/.release-plan.json
@@ -0,0 +1,18 @@
+{
+ "solution": {
+ "tether": {
+ "impact": "patch",
+ "oldVersion": "3.0.1",
+ "newVersion": "3.0.2",
+ "tagName": "latest",
+ "constraints": [
+ {
+ "impact": "patch",
+ "reason": "Appears in changelog section :bug: Bug Fix"
+ }
+ ],
+ "pkgJSONPath": "./package.json"
+ }
+ },
+ "description": "## Release (2025-12-07)\n\n* tether 3.0.2 (patch)\n\n#### :bug: Bug Fix\n* `tether`\n * [#1707](https://github.com/shipshapecode/tether/pull/1707) Guard against invalid removeChild ([@RobbieTheWagner](https://github.com/RobbieTheWagner))\n\n#### Committers: 1\n- Robbie Wagner ([@RobbieTheWagner](https://github.com/RobbieTheWagner))\n"
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b727ee3bf..74112d7b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,256 @@
+# Changelog
+
+## Release (2025-12-07)
+
+* tether 3.0.2 (patch)
+
+#### :bug: Bug Fix
+* `tether`
+ * [#1707](https://github.com/shipshapecode/tether/pull/1707) Guard against invalid removeChild ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+
+#### Committers: 1
+- Robbie Wagner ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+
+## Release (2025-12-05)
+
+* tether 3.0.1 (patch)
+
+#### :bug: Bug Fix
+* `tether`
+ * [#1705](https://github.com/shipshapecode/tether/pull/1705) Add prepare to ensure dist is published ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+
+#### Committers: 1
+- Robbie Wagner ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+
+## Release (2025-12-05)
+
+* tether 3.0.0 (major)
+
+#### :boom: Breaking Change
+* `tether`
+ * [#1114](https://github.com/shipshapecode/tether/pull/1114) Drop support for node < 16 ([@monshan](https://github.com/monshan))
+
+#### :rocket: Enhancement
+* `tether`
+ * [#1075](https://github.com/shipshapecode/tether/pull/1075) Remove the markers when tether is destroyed ([@pieter-v](https://github.com/pieter-v))
+
+#### :bug: Bug Fix
+* `tether`
+ * [#835](https://github.com/shipshapecode/tether/pull/835) Fix "document is not defined" error ([@diegohaz](https://github.com/diegohaz))
+
+#### :memo: Documentation
+* `tether`
+ * [#1052](https://github.com/shipshapecode/tether/pull/1052) docs: update CDN url ([@drl990114](https://github.com/drl990114))
+
+#### :house: Internal
+* `tether`
+ * [#1703](https://github.com/shipshapecode/tether/pull/1703) Add Release plan ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+ * [#1702](https://github.com/shipshapecode/tether/pull/1702) Switch to pnpm ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+
+#### Committers: 5
+- Haz ([@diegohaz](https://github.com/diegohaz))
+- Marika Shanahan ([@monshan](https://github.com/monshan))
+- Robbie Wagner ([@RobbieTheWagner](https://github.com/RobbieTheWagner))
+- [@pieter-v](https://github.com/pieter-v)
+- drl990114 ([@drl990114](https://github.com/drl990114))
+
+Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated.
+Deprecated as of 10.7.0. Please use highlight(code, options) instead.
+https://github.com/highlightjs/highlight.js/issues/2277
+
+## v2.0.0 (2021-03-26)
+
+#### :bug: Bug Fix
+* [#713](https://github.com/shipshapecode/tether/pull/713) Ensure parent still exists when removing event listeners ([@drewjenkins](https://github.com/drewjenkins))
+* [#692](https://github.com/shipshapecode/tether/pull/692) Guard against undefined markers type ([@rwwagner90](https://github.com/rwwagner90))
+
+#### :memo: Documentation
+* [#668](https://github.com/shipshapecode/tether/pull/668) Remove Bootstrap from list ([@MartijnCuppens](https://github.com/MartijnCuppens))
+* [#600](https://github.com/shipshapecode/tether/pull/600) Small Typo Fix ([@SebYLim](https://github.com/SebYLim))
+
+#### Committers: 5
+- Andrew Jenkins ([@drewjenkins](https://github.com/drewjenkins))
+- Martijn Cuppens ([@MartijnCuppens](https://github.com/MartijnCuppens))
+- Robert Wagner ([@rwwagner90](https://github.com/rwwagner90))
+- Sebastian Lim ([@SebYLim](https://github.com/SebYLim))
+- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)
+
+## [v2.0.0-beta.5](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.5) (2019-12-05)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v2.0.0-beta.4...v2.0.0-beta.5)
+
+**Implemented enhancements:**
+
+- Allow zeroElement parent to be configurable. [\#374](https://github.com/shipshapecode/tether/pull/374) ([deanmarano](https://github.com/deanmarano))
+
+**Merged pull requests:**
+
+- Bump rollup from 1.27.5 to 1.27.8 [\#403](https://github.com/shipshapecode/tether/pull/403) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-visualizer from 3.2.2 to 3.3.0 [\#402](https://github.com/shipshapecode/tether/pull/402) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.7.2 to 9.7.3 [\#400](https://github.com/shipshapecode/tether/pull/400) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump cypress from 3.6.1 to 3.7.0 [\#399](https://github.com/shipshapecode/tether/pull/399) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint from 6.7.1 to 6.7.2 [\#397](https://github.com/shipshapecode/tether/pull/397) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-browsersync from 1.0.0 to 1.1.0 [\#396](https://github.com/shipshapecode/tether/pull/396) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 23.0.4 to 23.1.1 [\#395](https://github.com/shipshapecode/tether/pull/395) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint from 6.6.0 to 6.7.1 [\#394](https://github.com/shipshapecode/tether/pull/394) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.7.1 to 9.7.2 [\#393](https://github.com/shipshapecode/tether/pull/393) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/preset-env from 7.7.1 to 7.7.4 [\#392](https://github.com/shipshapecode/tether/pull/392) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/core from 7.7.2 to 7.7.4 [\#391](https://github.com/shipshapecode/tether/pull/391) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump postcss from 7.0.21 to 7.0.23 [\#390](https://github.com/shipshapecode/tether/pull/390) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.27.1 to 1.27.5 [\#389](https://github.com/shipshapecode/tether/pull/389) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-visualizer from 3.1.1 to 3.2.2 [\#388](https://github.com/shipshapecode/tether/pull/388) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 23.0.3 to 23.0.4 [\#387](https://github.com/shipshapecode/tether/pull/387) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @testing-library/jest-dom from 4.2.3 to 4.2.4 [\#386](https://github.com/shipshapecode/tether/pull/386) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-visualizer from 2.7.2 to 3.1.1 [\#385](https://github.com/shipshapecode/tether/pull/385) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.26.5 to 1.27.1 [\#384](https://github.com/shipshapecode/tether/pull/384) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/preset-env from 7.6.3 to 7.7.1 [\#383](https://github.com/shipshapecode/tether/pull/383) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-visualizer from 2.6.0 to 2.7.2 [\#382](https://github.com/shipshapecode/tether/pull/382) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.26.0 to 1.26.5 [\#381](https://github.com/shipshapecode/tether/pull/381) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump cypress from 3.5.0 to 3.6.1 [\#380](https://github.com/shipshapecode/tether/pull/380) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/core from 7.6.4 to 7.7.2 [\#379](https://github.com/shipshapecode/tether/pull/379) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @testing-library/jest-dom from 4.2.0 to 4.2.3 [\#378](https://github.com/shipshapecode/tether/pull/378) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.7.0 to 9.7.1 [\#377](https://github.com/shipshapecode/tether/pull/377) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 23.0.0 to 23.0.3 [\#376](https://github.com/shipshapecode/tether/pull/376) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- test: Add more coverage to the module [\#375](https://github.com/shipshapecode/tether/pull/375) ([chuckcarpenter](https://github.com/chuckcarpenter))
+
+## [v2.0.0-beta.4](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.4) (2019-10-29)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v2.0.0-beta.3...v2.0.0-beta.4)
+
+**Implemented enhancements:**
+
+- Simplify Evented code [\#339](https://github.com/shipshapecode/tether/pull/339) ([rwwagner90](https://github.com/rwwagner90))
+
+**Closed issues:**
+
+- Tether is harder to update due to a missing changelog [\#40](https://github.com/shipshapecode/tether/issues/40)
+
+**Merged pull requests:**
+
+- Bump eslint from 6.5.1 to 6.6.0 [\#372](https://github.com/shipshapecode/tether/pull/372) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump postcss from 7.0.20 to 7.0.21 [\#371](https://github.com/shipshapecode/tether/pull/371) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 22.20.0 to 23.0.0 [\#370](https://github.com/shipshapecode/tether/pull/370) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.25.2 to 1.26.0 [\#369](https://github.com/shipshapecode/tether/pull/369) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @testing-library/jest-dom from 4.1.2 to 4.2.0 [\#368](https://github.com/shipshapecode/tether/pull/368) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Split constraints into smaller functions [\#367](https://github.com/shipshapecode/tether/pull/367) ([rwwagner90](https://github.com/rwwagner90))
+- Add dependabot config [\#366](https://github.com/shipshapecode/tether/pull/366) ([rwwagner90](https://github.com/rwwagner90))
+- Bump postcss from 7.0.18 to 7.0.20 [\#365](https://github.com/shipshapecode/tether/pull/365) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.6.5 to 9.7.0 [\#364](https://github.com/shipshapecode/tether/pull/364) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump cypress from 3.4.1 to 3.5.0 [\#363](https://github.com/shipshapecode/tether/pull/363) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.25.1 to 1.25.2 [\#362](https://github.com/shipshapecode/tether/pull/362) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 22.19.0 to 22.20.0 [\#361](https://github.com/shipshapecode/tether/pull/361) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.24.0 to 1.25.1 [\#360](https://github.com/shipshapecode/tether/pull/360) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Update getClass to util and add tests [\#359](https://github.com/shipshapecode/tether/pull/359) ([chuckcarpenter](https://github.com/chuckcarpenter))
+- Bump start-server-and-test from 1.10.5 to 1.10.6 [\#357](https://github.com/shipshapecode/tether/pull/357) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup-plugin-filesize from 6.2.0 to 6.2.1 [\#356](https://github.com/shipshapecode/tether/pull/356) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.23.1 to 1.24.0 [\#355](https://github.com/shipshapecode/tether/pull/355) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.6.4 to 9.6.5 [\#354](https://github.com/shipshapecode/tether/pull/354) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint-plugin-jest from 22.17.0 to 22.19.0 [\#353](https://github.com/shipshapecode/tether/pull/353) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/core from 7.6.3 to 7.6.4 [\#352](https://github.com/shipshapecode/tether/pull/352) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump start-server-and-test from 1.10.4 to 1.10.5 [\#350](https://github.com/shipshapecode/tether/pull/350) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/preset-env from 7.6.2 to 7.6.3 [\#349](https://github.com/shipshapecode/tether/pull/349) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/core from 7.6.2 to 7.6.3 [\#348](https://github.com/shipshapecode/tether/pull/348) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @testing-library/jest-dom from 4.1.1 to 4.1.2 [\#347](https://github.com/shipshapecode/tether/pull/347) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @testing-library/jest-dom from 4.1.0 to 4.1.1 [\#345](https://github.com/shipshapecode/tether/pull/345) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.23.0 to 1.23.1 [\#344](https://github.com/shipshapecode/tether/pull/344) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump autoprefixer from 9.6.1 to 9.6.4 [\#343](https://github.com/shipshapecode/tether/pull/343) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.22.0 to 1.23.0 [\#342](https://github.com/shipshapecode/tether/pull/342) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump start-server-and-test from 1.10.3 to 1.10.4 [\#341](https://github.com/shipshapecode/tether/pull/341) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump start-server-and-test from 1.10.2 to 1.10.3 [\#340](https://github.com/shipshapecode/tether/pull/340) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- chore: Add basic landing page for reloading and contribution [\#338](https://github.com/shipshapecode/tether/pull/338) ([chuckcarpenter](https://github.com/chuckcarpenter))
+- Bump eslint from 6.5.0 to 6.5.1 [\#337](https://github.com/shipshapecode/tether/pull/337) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump eslint from 6.4.0 to 6.5.0 [\#336](https://github.com/shipshapecode/tether/pull/336) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump rollup from 1.21.4 to 1.22.0 [\#335](https://github.com/shipshapecode/tether/pull/335) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Move some bounds utils [\#334](https://github.com/shipshapecode/tether/pull/334) ([rwwagner90](https://github.com/rwwagner90))
+
+## [v2.0.0-beta.3](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.3) (2019-09-30)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v2.0.0-beta.2...v2.0.0-beta.3)
+
+**Implemented enhancements:**
+
+- Option to disable `position: fixed` [\#152](https://github.com/shipshapecode/tether/issues/152)
+- Use type-check utils instead of typeof [\#333](https://github.com/shipshapecode/tether/pull/333) ([rwwagner90](https://github.com/rwwagner90))
+- Move TetherBase and use imports [\#328](https://github.com/shipshapecode/tether/pull/328) ([rwwagner90](https://github.com/rwwagner90))
+- Split out some utils [\#325](https://github.com/shipshapecode/tether/pull/325) ([rwwagner90](https://github.com/rwwagner90))
+- More offset utils and tests [\#319](https://github.com/shipshapecode/tether/pull/319) ([rwwagner90](https://github.com/rwwagner90))
+- Move offset to utils, add tests, test getClass [\#318](https://github.com/shipshapecode/tether/pull/318) ([rwwagner90](https://github.com/rwwagner90))
+- Refactor rollup config, add tests for pin and out-of-bounds [\#317](https://github.com/shipshapecode/tether/pull/317) ([rwwagner90](https://github.com/rwwagner90))
+- Move deferred utils to their own file [\#315](https://github.com/shipshapecode/tether/pull/315) ([rwwagner90](https://github.com/rwwagner90))
+
+**Fixed bugs:**
+
+- Uglify breaks library: "Super expression must either be null or a function, not undefined" [\#298](https://github.com/shipshapecode/tether/issues/298)
+- production build with angular cli \(uglify\) results in `undefined` error [\#295](https://github.com/shipshapecode/tether/issues/295)
+- Does not compile with parcel-bundler [\#284](https://github.com/shipshapecode/tether/issues/284)
+- Tether not initialize window.Tether when loaded by ReqireJS [\#257](https://github.com/shipshapecode/tether/issues/257)
+- Can't disable classes [\#253](https://github.com/shipshapecode/tether/issues/253)
+- Duplicate Identifiers within Tether.js Library [\#206](https://github.com/shipshapecode/tether/issues/206)
+- Remove classes when set to false [\#329](https://github.com/shipshapecode/tether/pull/329) ([rwwagner90](https://github.com/rwwagner90))
+
+**Closed issues:**
+
+- Action required: Greenkeeper could not be activated đ¨ [\#304](https://github.com/shipshapecode/tether/issues/304)
+- Import of Evented from TetherBase.Utils instead of global scope [\#261](https://github.com/shipshapecode/tether/issues/261)
+- SVGAnimatedString is not defined [\#201](https://github.com/shipshapecode/tether/issues/201)
+- Option to not append to the body [\#189](https://github.com/shipshapecode/tether/issues/189)
+- UglifyJS warnings [\#183](https://github.com/shipshapecode/tether/issues/183)
+- Clean up on destroy [\#36](https://github.com/shipshapecode/tether/issues/36)
+
+**Merged pull requests:**
+
+- Document events [\#331](https://github.com/shipshapecode/tether/pull/331) ([rwwagner90](https://github.com/rwwagner90))
+- Add test for fixed anchoring on scroll [\#330](https://github.com/shipshapecode/tether/pull/330) ([chuckcarpenter](https://github.com/chuckcarpenter))
+- Remove facebook example [\#327](https://github.com/shipshapecode/tether/pull/327) ([rwwagner90](https://github.com/rwwagner90))
+- chore: Remove example of 3rd party lib [\#326](https://github.com/shipshapecode/tether/pull/326) ([chuckcarpenter](https://github.com/chuckcarpenter))
+- Bump eslint-plugin-ship-shape from 0.6.0 to 0.7.1 [\#324](https://github.com/shipshapecode/tether/pull/324) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- test: Remove tooltip example from outside lib [\#323](https://github.com/shipshapecode/tether/pull/323) ([chuckcarpenter](https://github.com/chuckcarpenter))
+- Bump sinon from 7.4.2 to 7.5.0 [\#322](https://github.com/shipshapecode/tether/pull/322) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/core from 7.6.0 to 7.6.2 [\#321](https://github.com/shipshapecode/tether/pull/321) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Bump @babel/preset-env from 7.6.0 to 7.6.2 [\#320](https://github.com/shipshapecode/tether/pull/320) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+- Remove classes on destroy [\#316](https://github.com/shipshapecode/tether/pull/316) ([rwwagner90](https://github.com/rwwagner90))
+- Bump rollup from 1.21.3 to 1.21.4 [\#314](https://github.com/shipshapecode/tether/pull/314) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
+
+## [v2.0.0-beta.2](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.2) (2019-09-18)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v2.0.0-beta.1...v2.0.0-beta.2)
+
+## [v2.0.0-beta.1](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.1) (2019-09-18)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v2.0.0-beta.0...v2.0.0-beta.1)
+
+## [v2.0.0-beta.0](https://github.com/shipshapecode/tether/tree/v2.0.0-beta.0) (2019-09-18)
+
+[Full Changelog](https://github.com/shipshapecode/tether/compare/v1.4.7...v2.0.0-beta.0)
+
+**Breaking changes:**
+
+- Remove dist from git [\#311](https://github.com/shipshapecode/tether/pull/311) ([rwwagner90](https://github.com/rwwagner90))
+- Move class utils to a utils file, drop IE9 support [\#310](https://github.com/shipshapecode/tether/pull/310) ([rwwagner90](https://github.com/rwwagner90))
+
+**Implemented enhancements:**
+
+- Return `this` in Evented class for easy chaining [\#309](https://github.com/shipshapecode/tether/pull/309) ([rwwagner90](https://github.com/rwwagner90))
+- Add `allowPositionFixed` optimization option [\#308](https://github.com/shipshapecode/tether/pull/308) ([rwwagner90](https://github.com/rwwagner90))
+
+**Closed issues:**
+
+- Transferring ownership [\#303](https://github.com/shipshapecode/tether/issues/303)
+- No test cases to run the package [\#293](https://github.com/shipshapecode/tether/issues/293)
+- Not Compatible with TypeScript compiler [\#263](https://github.com/shipshapecode/tether/issues/263)
+- dist/js/tether.min.js is outdated [\#256](https://github.com/shipshapecode/tether/issues/256)
+- no version information in min.js [\#239](https://github.com/shipshapecode/tether/issues/239)
+
+**Merged pull requests:**
+
+- Add tests for enable/disable [\#306](https://github.com/shipshapecode/tether/pull/306) ([rwwagner90](https://github.com/rwwagner90))
+- Add basic tests, sass -\> scss, gulp -\> rollup, etc [\#305](https://github.com/shipshapecode/tether/pull/305) ([rwwagner90](https://github.com/rwwagner90))
+- Fix code example in README.md [\#216](https://github.com/shipshapecode/tether/pull/216) ([Stanton](https://github.com/Stanton))
+- Add reactstrap to examples of projects using tether [\#211](https://github.com/shipshapecode/tether/pull/211) ([eddywashere](https://github.com/eddywashere))
+
+## v1.3.0
+- Tether instances now fire an 'update' event when attachments change due to constraints (#119)
+
## v1.0.1
- Update arrow mixin to change arrow pointer event
@@ -8,3 +261,6 @@
- Update build steps
- Add changelog
- Provide minified CSS
+
+
+\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8e4b9c542..6c82a6241 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,58 +2,51 @@
You will need:
-- Node.js/io.js & npm
-- Bower
-- Gulp
+- [pnpm](https://pnpm.io/)
+Windows users will need additional setup to enable build capabilities in NPM.
+From an administrative command window:
+
+```sh
+ pnpm global add windows-build-tools
+```
## Getting started
1. Fork the project
2. Clone your forked project by running `git clone git@github.com:{
YOUR_USERNAME }/tether.git`
-3. Run `npm install` to install both node modules and bower components
-4. Test that you can build the source by moving/renaming the existing `dist`
- directory and running `npm run build`
-5. Assuming everything went well, you should now have a `dist` directory that
- matches the one you moved in step 4
-
+3. Run `pnpm` to install node modules
+4. Test that you can build the source by running `pnpm build` and ensure the `dist` directory appears.
## Writing code!
-We use `gulp` to facilitate things like transpilation, minification, etc. so
-can you focus on writing relevant code. If there is a fix or feature you would like
+We use `rollup` to facilitate things like transpilation, minification, etc. so
+you can focus on writing relevant code. If there is a fix or feature you would like
to contribute, we ask that you take the following steps:
1. Most of the _editable_ code lives in the `src` directory while built code
- will end up in the `dist` directory upon running `npm run build`.
+ will end up in the `dist` directory upon running `pnpm build`.
-2. Depending on how big your changes are, bump the version numbers appropriately
- in `bower.json` and `package.json`. We try to follow semver, so a good rule
- of thumb for how to bump the version is:
- - A fix to existing code, perform a patch bump e.g. x.x.0 -> x.x.1
- - New feature, perform a minor bump e.g. x.0.x -> x.1.x
- - Breaking changes such a rewrite, perform a major bump e.g.
- 1.x.x -> 2.x.x
+2. Some examples are served out of the `examples` directory. Running `pnpm start` will open the list in your browser and initiate a live-reloading session as you make changes.
- Versioning is hard, so just use good judgement and we'll be more than happy
- to help out.
- __NOTE__: There is a `gulp` task that will automate some of the versioning.
- You can run `gulp version:{type}` where type is `patch|minor|major` to
- update both `bower.json` and `package.json` as well as add the appropriate
- git tag.
+## Opening Pull Requests
-3. Provide a thoughtful commit message and push your changes to your fork using
+1. Please Provide a thoughtful commit message and push your changes to your fork using
`git push origin master` (assuming your forked project is using `origin` for
the remote name and you are on the `master` branch).
-4. Open a Pull Request on GitHub with a description of your changes.
+2. Open a Pull Request on GitHub with a description of your changes.
## Testing
-Work in progress. We are hoping to add some tests, so if you would like to help
-us get started, feel free to contact us through the Issues or open a Pull
-Request.
+All PRs, that change code functionality, are required to have accompanying tests.
+
+### Acceptance Tests
+
+Acceptance tests are run using [`cypress`](https://github.com/cypress-io/cypress). A number of different testing configurations can be found in [`package.json`](/package.json), but you can simply run `pnpm test:ci:watch` to build your latest changes and begin running the tests inside a Chrome browser instance.
+
+â ď¸ The acceptance tests are set up to run on `localhost` port `9002`. If you'd like to change this port, make sure to change the `baseUrl` option inside of [`cypress.json`](/cypress.json), and change any references to port `9002` in [`package.json`](/package.json) accordingly.
diff --git a/HISTORY.md b/HISTORY.md
new file mode 100644
index 000000000..d5a8047ff
--- /dev/null
+++ b/HISTORY.md
@@ -0,0 +1,13 @@
+## v1.3.0
+- Tether instances now fire an 'update' event when attachments change due to constraints (#119)
+
+## v1.0.1
+- Update arrow mixin to change arrow pointer event
+
+
+## v1.0.0
+- Coffeescript -> ES6
+- Proper UMD Wrapper
+- Update build steps
+- Add changelog
+- Provide minified CSS
diff --git a/LICENSE b/LICENSE
index 2b88ccf3e..cae56ac87 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,5 @@
-Copyright (c) 2014 HubSpot, Inc.
+Copyright (c) 2014-2019 HubSpot, Inc.
+Copyright (c) 2019-2022 Ship Shape Consulting LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/README.md b/README.md
index 9d99afaf6..5294b82de 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,125 @@
-## Tether
+# Tether
-[](http://badge.fury.io/js/tether)
-[](http://badge.fury.io/bo/tether)
+
+
+
+
+
+ **[Tether is maintained by Ship Shape. Contact us for web app consulting, development, and training for your project](https://shipshape.io/services/app-development/)**.
+
-Tether is a JavaScript library for efficiently making an absolutely positioned element stay next to another element on the page.
+[](http://badge.fury.io/js/tether)
+
+[]()
+
+[](https://github.com/shipshapecode/tether/actions/workflows/main.yml)
-It aims to be the canonical implementation of this type of positioning, such that you can build products, not positioning libraries.
+## đ Project status đ
-Take a look at the documentation for a more detailed explanation of why you should star it now to remember it for your next project.
+We at Ship Shape have recently taken over Tether's maintenance and hope to modernize and revitalize it. Stay tuned for updates!
## Install
__npm__
```sh
-$ npm install tether
+npm install tether
```
-__bower__
+For the latest beta:
+
```sh
-$ bower install tether
+npm install tether@next
+```
+
+__download__
+
+Or download from the [releases](https://github.com/shipshapecode/tether/releases).
+
+## Introduction
+
+[Tether](http://tetherjs.dev/) is a small, focused JavaScript library for defining and managing the position of user interface (UI) elements in relation to one another on a web page. It is a tool for web developers building features that require certain UI elements to be precisely positioned based on the location of another UI element.
+
+There are often situations in UI development where elements need to be attached to other elements, but placing them right next to each other in the [DOM tree](https://en.wikipedia.org/wiki/Document_Object_Model) can be problematic based on the context. For example, what happens if the element weâre attaching other elements to is fixed to the center of the screen? Or what if the element is inside a scrollable container? How can we prevent the attached element from being clipped as it disappears from view while a user is scrolling? Tether can solve all of these problems and more.
+
+Some common UI elements that have been built with Tether are [tooltips](http://github.hubspot.com/tooltip/docs/welcome), [select menus](http://github.hubspot.com/select/docs/welcome), and [dropdown menus](http://github.hubspot.com/drop/docs/welcome). Tether is flexible and can be used to [solve](http://tetherjs.dev/examples/out-of-bounds/) [all](http://tetherjs.dev/examples/content-visible) [kinds](http://tetherjs.dev/examples/element-scroll) [of](http://tetherjs.dev/examples/enable-disable) interesting [problems](http://tetherjs.dev/examples/viewport); it ensures UI elements stay where they need to be, based on the various user interactions (click, scroll, etc) and layout contexts (fixed positioning, inside scrollable containers, etc).
+
+Please have a look at the [documentation](http://tetherjs.dev/) for a more detailed explanation of why you might need Tether for your next project.
+
+## What to Use Tether for and When to Use It
+
+Tether is a small, focused JavaScript library. For those who might be new to JavaScript, a library is simply a JavaScript file (or files) that contain useful JavaScript code to help achieve tasks easier and faster. Since Tether is a JavaScript user interface (**UI**) library, it contains code to help you to manage the way your website or web app appears.
+
+Tetherâs goal to is to help you position your elements side-by-side when needed.
+
+Letâs say youâve started working on your dream project—a fancy web app thatâs sure to become the next big thing! An important feature of your new app is to allow users to comment on shared photos. However, due to limited vertical space and the overall layout of your new app, youâd like to display the comments **next** to the image, similar to how Instagram does it.
+
+Your HTML code might look something like this:
+
+```html
+
-"""
-
-tethers = {}
-
-getOutput = ($block) ->
- key = $block.data('example')
- if key and typeof key is 'string'
- return $("output[data-example='#{ key }']")
- else
- return $block.parents('pre').nextAll('output').first()
-
-run = (key) ->
- if typeof key is 'string'
- $block = $("code[data-example='#{ key }']")
- else
- $block = key
-
- key = $block.attr('data-example')
-
- $output = getOutput $block
-
- code = $block.text()
- code = SETUP_JS + code
-
- window.$output = $output
- tethers[key] = eval code
-
-setupBlock = ($block) ->
- key = $block.data('example')
-
- $output = getOutput $block
-
- if not key
- key = uniqueId()
- $block.attr('data-example', key)
- $output.attr('data-example', key)
- $output.find('.tether-element').attr('data-example', key)
-
- $output.html OUTPUT_HTML(key)
-
- $scrollBox = $output.find('.scroll-box')
- $scrollContent = $scrollBox.find('.scroll-content')
- $scrollBox.scrollTop(parseInt($scrollContent.css('height')) / 2 - $scrollBox.height() / 2)
- $scrollBox.scrollLeft(parseInt($scrollContent.css('width')) / 2 - $scrollBox.width() / 2)
- setTimeout ->
- $scrollBox.on 'scroll', ->
- $output.addClass 'scrolled'
-
- $scrollBox.css 'height', "#{ $block.parent().outerHeight() }px"
-
- if not $output.attr('deactivated')?
- run $block
-
-$(document.body).on 'click', (e) ->
- if $(e.target).is('output[deactivated]')
- activate $(e.target)
- false
- else if $(e.target).is('output[activated]')
- deactivate $(e.target)
- false
-
-activate = ($output) ->
- $block = $output.prev().find('code')
-
- run $block
-
- $output.find('.tether-element').show()
-
- key = $output.data('example')
- $(tethers[key].element).show()
- tethers[key].enable()
-
- $output.removeAttr('deactivated')
- $output.attr('activated', true)
-
-deactivate = ($output) ->
- $block = $output.prev().find('code')
- key = $output.data('example')
-
- tethers[key].disable()
-
- $el = $(tethers[key].element)
- $el.detach()
- $output.find('.scroll-content').append $el
- $el.hide()
-
- $output.removeAttr('activated')
- $output.attr('deactivated', true)
-
-init = ->
- $blocks = $('code[data-example]')
-
- setupBlock($ block) for block in $blocks
-
-window.EXECUTR_OPTIONS =
- codeSelector: 'code[executable]'
-
-$ init
diff --git a/docs/intro.md b/docs/intro.md
index c1fd45fb8..aed1f29b2 100644
--- a/docs/intro.md
+++ b/docs/intro.md
@@ -1,5 +1,4 @@
-
@@ -21,7 +20,7 @@ Tether optimizes its location placement to result in the minimum amount of
scrolling even with dozens or hundreds of tethers on screen (pop open the
devtools timeline as you scroll this page).
-Tether is 5kb minified and gzipped, and supports IE9+, and all modern
+Tether is 5kb minified and gzipped, and supports IE 10+, and all modern
browsers.
Projects Built With Tether
@@ -97,7 +96,7 @@ All told, Tether provides six built in attachment positions:
- middle
- bottom
-The syntax of the attachment properties is: `"vertical-attachment horizontal-attachment"`
+The syntax of the attachment properties is: `"vertical-attachment horizontal-attachment"`.
You must always supply an `attachment`. If you don't supply a `target-attachment`, it is
assumed to be the mirror image of `attachment`.
@@ -284,8 +283,7 @@ Together is the option you will use most commonly:
});
-You can also provide different settings for the horizontal
-and vertical attachments:
+You can also provide different settings for the vertical and horizontal attachments:
new Tether({
element: yellowBox,
@@ -459,6 +457,24 @@ The `Tether` object has these methods:
- `destroy()` - Disable and remove all references
- `position()` - Manually trigger a repositioning
+Events
+------
+
+The `Tether` object also has events support, since it extends our `Evented` class.
+
+The methods exposed to listen to events are:
+
+- `on(event, handler)` - Adds an event listener that is fired whenever the event is fired
+- `once(event, handler)` - Adds an event listener that is only fired the first time the event is fired
+- `off(event, handler)` - Removes the event listener
+- `trigger(event)` - Manually triggers events
+
+The events fired are:
+
+- `repositioned` - Fired whenever the tether element is moved
+- `update` - Fired whenever the Tether instance runs into a constraint. You could use this
+for things like manually flipping an arrow or other tweaks.
+
Options
-------
diff --git a/docs/js/intro.js b/docs/js/intro.js
index 47ed6e5b3..029dee3a9 100644
--- a/docs/js/intro.js
+++ b/docs/js/intro.js
@@ -1,7 +1,10 @@
(function() {
var OUTPUT_HTML, SETUP_JS, activate, deactivate, getOutput, init, run, setupBlock, tethers, uniqueId;
- uniqueId = Tether.Utils.uniqueId;
+ uniqueId = (function() {
+ var id = 0;
+ return function(){ return ++id };
+ })();
SETUP_JS = "yellowBox = $('.yellow-box', $output);\ngreenBox = $('.green-box', $output);\nscrollBox = $('.scroll-box', $output);";
diff --git a/docs/js/markAttachment.js b/docs/js/markAttachment.js
deleted file mode 100644
index c7d34f088..000000000
--- a/docs/js/markAttachment.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* globals Tether */
-
-'use strict';
-
-Tether.modules.push({
- initialize: function initialize() {
- var _this = this;
-
- this.markers = {};
-
- ['target', 'element'].forEach(function (type) {
- var el = document.createElement('div');
- el.className = _this.getClass('' + type + '-marker');
-
- var dot = document.createElement('div');
- dot.className = _this.getClass('marker-dot');
- el.appendChild(dot);
-
- _this[type].appendChild(el);
-
- _this.markers[type] = { dot: dot, el: el };
- });
- },
-
- position: function position(_ref) {
- var manualOffset = _ref.manualOffset;
- var manualTargetOffset = _ref.manualTargetOffset;
-
- var offsets = {
- element: manualOffset,
- target: manualTargetOffset
- };
-
- for (var type in offsets) {
- var offset = offsets[type];
- for (var side in offset) {
- var val = offset[side];
- var notString = typeof val !== 'string';
- if (notString || val.indexOf('%') === -1 && val.indexOf('px') === -1) {
- val += 'px';
- }
-
- if (this.markers[type].dot.style[side] !== val) {
- this.markers[type].dot.style[side] = val;
- }
- }
- }
-
- return true;
- }
-});
diff --git a/docs/welcome/browser-demo.html b/docs/welcome/browser-demo.html
index f6fdea418..6c13c55cd 100644
--- a/docs/welcome/browser-demo.html
+++ b/docs/welcome/browser-demo.html
@@ -10,10 +10,10 @@
-
+
-
+