-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
84 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* All draggable plugins inherit from this class. | ||
* @abstract | ||
* @class AbstractPlugin | ||
* @module AbstractPlugin | ||
*/ | ||
export default class AbstractPlugin { | ||
|
||
/** | ||
* AbstractPlugin constructor. | ||
* @constructs AbstractPlugin | ||
* @param {Draggable} draggable - Draggable instance | ||
*/ | ||
constructor(draggable) { | ||
|
||
/** | ||
* Draggable instance | ||
* @property draggable | ||
* @type {Draggable} | ||
*/ | ||
this.draggable = draggable; | ||
} | ||
|
||
/** | ||
* Override to add listeners | ||
* @abstract | ||
*/ | ||
attach() { | ||
throw new Error('Not Implemented'); | ||
} | ||
|
||
/** | ||
* Override to remove listeners | ||
* @abstract | ||
*/ | ||
detach() { | ||
throw new Error('Not Implemented'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Abstract plugin | ||
|
||
This is the base class for all draggable plugins. | ||
|
||
### API | ||
|
||
**`new AbstractPlugin(draggable: Draggable): AbstractPlugin`** | ||
Creates an `AbstractPlugin` instance. | ||
|
||
**`abstractEvent.attach(): void`** | ||
Attaches listeners for plugin. | ||
|
||
**`abstractEvent.detach(): void`** | ||
Detaches listeners for plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AbstractPlugin from './AbstractPlugin'; | ||
|
||
export default AbstractPlugin; |