Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
updated docs format
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoravelino committed Mar 14, 2017
1 parent 3b6341a commit 78e8ef6
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 26 deletions.
14 changes: 0 additions & 14 deletions app/assets/javascripts/base/component.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
/* eslint-disable class-methods-use-this */

//
// BaseComponent class to avoid boilerplate code
// into component classes and add some convention.
//
// The subclasses are not obligated to implement all
// of these methods but if they need to perform an action
// that fits one of the descriptions below, it's highly
// recommended to use the proper method.
//
class BaseComponent {
//
// Calls in order 'elements()', 'events()', 'beforeMount()',
// 'mount()' and 'mounted()'.
//
constructor(el) {
this.$el = el;

Expand All @@ -24,29 +20,19 @@ class BaseComponent {
this.mounted();
}

//
// Caches HTML elements for further use.
//
elements() { }

//
// Attaches listeners to events triggered by HTML elements.
//
events() { }

//
// Before mount hook.
//
beforeMount() { }

//
// Renders the component.
//
mount() { }

//
// After mount hook.
//
mounted() { }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ const TOGGLE_LINK_ICON = `${TOGGLE_LINK} i`;
const APP_TOKEN_FORM = '#add_application_token_form';
const APP_TOKEN_FIELD = '#application_token_application';

//
// ApplicationTokenPanel component that handles application
// token interactions.
//
class ApplicationTokenPanel extends BaseComponent {
elements() {
this.$toggle = this.$el.find(TOGGLE_LINK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ const NEW_PASSWORD_FIELD = '#user_password';
const NEW_CONFIRMATION_PASSWORD_FIELD = '#user_password_confirmation';
const SUBMIT_BUTTON = 'input[type=submit]';

//
// UsersPasswordForm component that handles user password form
// interactions.
//
class UsersPasswordForm extends BaseComponent {
elements() {
this.$currentPassword = this.$el.find(CURRENT_PASSWORD_FIELD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const EMAIL_FIELD = '#user_email';
const DISPLAY_NAME_FIELD = '#user_display_name';
const SUBMIT_BUTTON = 'input[type=submit]';

//
// UsersProfileForm component handles user profile form
// interactions.
//
class UsersProfileForm extends BaseComponent {
elements() {
this.$email = this.$el.find(EMAIL_FIELD);
Expand Down
2 changes: 0 additions & 2 deletions app/assets/javascripts/modules/users/pages/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ const PROFILE_FORM = 'form.profile';
const PASSWORD_FORM = 'form.password';
const APP_TOKEN_PANEL = '.app-token-wrapper';

//
// UsersEditPage component responsible to instantiate
// the user's edit page components and handle interactions.
//
class UsersEditPage extends BaseComponent {
elements() {
this.$profileForm = this.$el.find(PROFILE_FORM);
Expand Down
2 changes: 0 additions & 2 deletions app/assets/javascripts/modules/users/pages/sign-in.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import BaseComponent from '~/base/component';

import { fadeIn } from '~/utils/effects';

//
// UsersSignInPage component responsible to instantiate
// the user's sign in page components and handle interactions.
//
class UsersSignInPage extends BaseComponent {
mount() {
fadeIn(this.$el);
Expand Down
2 changes: 0 additions & 2 deletions app/assets/javascripts/modules/users/pages/sign-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import BaseComponent from '~/base/component';

import { fadeIn } from '~/utils/effects';

//
// UsersSignUpPage component responsible to instantiate
// the user's sign up page components and handle interactions.
//
class UsersSignUpPage extends BaseComponent {
mount() {
fadeIn(this.$el);
Expand Down

0 comments on commit 78e8ef6

Please sign in to comment.