This repository was archived by the owner on May 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Feature/basic core cleanup #33
Open
swey
wants to merge
7
commits into
unic:develop
Choose a base branch
from
swey:feature/basic-core-cleanup
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
32ad302
fixed and improved JS scaffolding
swey 974a3e7
moved the module class registration to the main.js again (should be o…
swey d8ccf82
further improvement of the scaffolding (removed the name constant)
swey 04d65e9
adjusted the instance's name to class' name
swey 16a5113
adjusted the scaffolding gulp task to the new naming
swey f70794f
Merge branch 'feature/better-js-scaffolding' into feature/basic-core-…
swey 67863a1
name refactoring
swey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,59 +1,58 @@ | ||
| /*! | ||
| import EstaticoModule from '../../assets/js/helpers/module'; | ||
|
|
||
| /* | ||
| * {{originalName}} | ||
| * | ||
| * @author | ||
| * @copyright | ||
| */ | ||
| import EstaticoModule from '../../assets/js/helpers/module'; | ||
|
|
||
| class {{className}} extends EstaticoModule { | ||
| export default class {{className}} extends EstaticoModule { | ||
| static events = { | ||
| // eventname: `eventname.estatico.${{{className}}.name}` | ||
| }; | ||
| static defaultData = {}; | ||
| static defaultOptions = { | ||
| domSelectors: { | ||
| // item: `[data-${{{className}}.name}}="item"]` | ||
| }, | ||
| stateClasses: { | ||
| // activated: 'is_activated' | ||
| } | ||
| }; | ||
|
|
||
| constructor($element, data, options) { | ||
| let _defaultData = {}, | ||
| _name = '{{name}}', | ||
| _defaultOptions = { | ||
| domSelectors: { | ||
| // item: '[data-' + _name + '="item"]' | ||
| }, | ||
| stateClasses: { | ||
| // activated: 'is_activated' | ||
| } | ||
| }; | ||
|
|
||
| super($element, _defaultData, _defaultOptions, data, options); | ||
| super($element, {{className}}.defaultData, {{className}}.defaultOptions, data, options); | ||
|
|
||
| this._initUi(); | ||
| this._initEventListeners(); | ||
| } | ||
|
|
||
| static get events() { | ||
| return { | ||
| // eventname: 'eventname.estatico.' + {{name}} | ||
| }; | ||
| /** | ||
| * Unbind events, remove data, custom teardown | ||
| * | ||
| * @public | ||
| */ | ||
| destroy() { | ||
| super.destroy(); | ||
|
|
||
| // Custom destroy actions go here | ||
| } | ||
|
|
||
| /** | ||
| * Initialisation of variables, which point to DOM elements | ||
| * | ||
| * @private | ||
| */ | ||
| _initUi() { | ||
| // DOM element pointers | ||
| } | ||
|
|
||
| /** | ||
| * Event listeners initialisation | ||
| * | ||
| * @private | ||
| */ | ||
| _initEventListeners() { | ||
| // Event listeners | ||
| } | ||
|
|
||
| /** | ||
| * Unbind events, remove data, custom teardown | ||
| */ | ||
| destroy() { | ||
| super.destroy(); | ||
|
|
||
| // Custom destroy actions go here | ||
| } | ||
| } | ||
|
|
||
| export default {{className}}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See discussion in #32
@orioltf, we should sit together and have a look at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@backflip sure thing! Willing to!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@backflip just tried it in current project (didn't have a look in depth) without success. I think that removing this needs more check, so we probably need to test it in a clean project first.