Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct JQuery #92

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 50 additions & 52 deletions addon/components/bulma-modal.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,74 @@
import Ember from 'ember';
import layout from '../templates/components/bulma-modal';
import { _helpers } from '../constants';
import Ember from "ember";
import layout from "../templates/components/bulma-modal";
import { _helpers } from "../constants";

const {
Component,
run: { schedule, bind },
get,
$: _$
get
} = Ember;

/**
* A classic modal overlay, in which you can include any content you want
*
* @class BulmaModal
* @extends Ember Component
* @private
*/
* A classic modal overlay, in which you can include any content you want
*
* @class BulmaModal
* @extends Ember Component
* @private
*/

export default Component.extend({
layout,
classNames: ['modal'],
classNameBindings: ['show:is-active'].concat(_helpers),
classNames: ["modal"],
classNameBindings: ["show:is-active"].concat(_helpers),
/**
* Include background container
*
* @property withBackground
* @type Boolean
* @default true
* @public
*/
* Include background container
*
* @property withBackground
* @type Boolean
* @default true
* @public
*/
withBackground: true,

/**
* Wraps content with .modal-container which also centers content
*
* @property isCentered
* @type Boolean
* @default true
* @public
*/
* Wraps content with .modal-container which also centers content
*
* @property isCentered
* @type Boolean
* @default true
* @public
*/
isCentered: true,

/**
* Include close button
*
* @property withClose
* @type Boolean
* @default true
* @public
*/
* Include close button
*
* @property withClose
* @type Boolean
* @default true
* @public
*/
withClose: true,

/**
* Function to apply when closing modal
*
* @property onclose
* @type Function
* @default null
* @public
*/
* Function to apply when closing modal
*
* @property onclose
* @type Function
* @default null
* @public
*/
onclose: null,

/**
* Execute on close when escape is pressed
*
* @method escapeHandler
* @private
*/
* Execute on close when escape is pressed
*
* @method escapeHandler
* @private
*/
escapeHandler(e) {
if (get(this, 'onclose') && get(e, 'keyCode') === 27) {
get(this, 'onclose')();
if (get(this, "onclose") && get(e, "keyCode") === 27) {
get(this, "onclose")();
}
},

Expand All @@ -80,9 +79,8 @@ export default Component.extend({
* @private
*/
attachKeyUpHandlers() {
schedule('afterRender', () => {
_$(document).on('keyup.ember-bulma-modal',
bind(this, this.escapeHandler));
schedule("afterRender", () => {
$(document).on("keyup.ember-bulma-modal", bind(this, this.escapeHandler));
});
},

Expand All @@ -93,7 +91,7 @@ export default Component.extend({
* @private
*/
detachKeyUpHandlers() {
_$(document).off('keyup.ember-bulma-modal');
$(document).off("keyup.ember-bulma-modal");
},

init() {
Expand Down
15 changes: 7 additions & 8 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const { types, scopes } = require('./commitizen.config');
const { types, scopes } = require("./commitizen.config");

const validTypes = types.map((type) => type.value);
const validScopes = scopes.map((scope) => scope.name);
const validTypes = types.map(type => type.value);
const validScopes = scopes.map(scope => scope.name);

module.exports = {
extends: ['@commitlint/config-angular'],
extends: ["@commitlint/config-angular"],

rules: {
'body-leading-blank': [2, 'always'],
'body-tense': [0, 'always', ['present-imperative']],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been removed in the linter upstream. Building with a fresh install via npm wouldn't work with it for me.

'scope-enum': [1, 'always', validScopes],
'type-enum': [2, 'always', validTypes]
"body-leading-blank": [2, "always"],
"scope-enum": [1, "always", validScopes],
"type-enum": [2, "always", validTypes]
}
};
Loading