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

Fix typeahead adds showClass to wrong element #41

Open
wants to merge 4 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
288 changes: 144 additions & 144 deletions dist/amd/accordion/aubs-accordion-group.js
Original file line number Diff line number Diff line change
@@ -1,145 +1,145 @@
define(["exports", "aurelia-framework", "../utils/bootstrap-options", "velocity-animate", "./aubs-accordion"], function (exports, _aureliaFramework, _bootstrapOptions, _velocityAnimate, _aubsAccordion) {
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AubsAccordionGroupCustomElement = undefined;

var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);

function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}

function _initDefineProp(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
});
}

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}

function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object['ke' + 'ys'](descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;

if ('value' in desc || desc.initializer) {
desc.writable = true;
}

desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);

if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}

if (desc.initializer === void 0) {
Object['define' + 'Property'](target, property, desc);
desc = null;
}

return desc;
}

function _initializerWarningHelper(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}

var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;

var AubsAccordionGroupCustomElement = exports.AubsAccordionGroupCustomElement = (_dec = (0, _aureliaFramework.inject)(_aubsAccordion.AubsAccordionCustomElement), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (0, _aureliaFramework.containerless)(_class = _dec(_class = (_class2 = function () {
function AubsAccordionGroupCustomElement(accordion) {
_classCallCheck(this, AubsAccordionGroupCustomElement);

_initDefineProp(this, "title", _descriptor, this);

_initDefineProp(this, "panelClass", _descriptor2, this);

_initDefineProp(this, "isOpen", _descriptor3, this);

_initDefineProp(this, "disabled", _descriptor4, this);

this.accordion = accordion;
this.accordion.register(this);
}

AubsAccordionGroupCustomElement.prototype.bind = function bind() {
if (typeof this.isOpen !== 'boolean') {
this.isOpen = false;
}

this.showClass = this.isBootstrapVersion(4) ? 'show' : 'in';
};

AubsAccordionGroupCustomElement.prototype.attached = function attached() {
if (this.isOpen) {
this.$collapse.classList.add('in');
(0, _velocityAnimate2.default)(this.$collapse, 'slideDown', { duration: 0 });
}
};

AubsAccordionGroupCustomElement.prototype.isBootstrapVersion = function isBootstrapVersion(version) {
return _bootstrapOptions.bootstrapOptions.version === version;
};

AubsAccordionGroupCustomElement.prototype.isOpenChanged = function isOpenChanged() {
this.animate();

if (this.isOpen) {
this.accordion.groupToggled(this);
}
};

AubsAccordionGroupCustomElement.prototype.toggle = function toggle() {
this.isOpen = !this.isOpen;
};

AubsAccordionGroupCustomElement.prototype.animate = function animate() {
if (this.isOpen) {
this.$collapse.classList.add(this.showClass);
(0, _velocityAnimate2.default)(this.$collapse, 'slideDown');
} else {
(0, _velocityAnimate2.default)(this.$collapse, 'slideUp');
this.$collapse.classList.remove(this.showClass);
}
};

return AubsAccordionGroupCustomElement;
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "title", [_aureliaFramework.bindable], {
enumerable: true,
initializer: null
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "panelClass", [_aureliaFramework.bindable], {
enumerable: true,
initializer: function initializer() {
return _bootstrapOptions.bootstrapOptions.accordionGroupPanelClass;
}
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "isOpen", [_dec2], {
enumerable: true,
initializer: function initializer() {
return false;
}
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "disabled", [_aureliaFramework.bindable], {
enumerable: true,
initializer: function initializer() {
return false;
}
})), _class2)) || _class) || _class);
define(["exports", "aurelia-framework", "../utils/bootstrap-options", "velocity-animate", "./aubs-accordion"], function (exports, _aureliaFramework, _bootstrapOptions, _velocityAnimate, _aubsAccordion) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AubsAccordionGroupCustomElement = undefined;
var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _initDefineProp(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
});
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
var desc = {};
Object['ke' + 'ys'](descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ('value' in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object['define' + 'Property'](target, property, desc);
desc = null;
}
return desc;
}
function _initializerWarningHelper(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}
var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
var AubsAccordionGroupCustomElement = exports.AubsAccordionGroupCustomElement = (_dec = (0, _aureliaFramework.inject)(_aubsAccordion.AubsAccordionCustomElement), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), (0, _aureliaFramework.containerless)(_class = _dec(_class = (_class2 = function () {
function AubsAccordionGroupCustomElement(accordion) {
_classCallCheck(this, AubsAccordionGroupCustomElement);
_initDefineProp(this, "title", _descriptor, this);
_initDefineProp(this, "panelClass", _descriptor2, this);
_initDefineProp(this, "isOpen", _descriptor3, this);
_initDefineProp(this, "disabled", _descriptor4, this);
this.accordion = accordion;
this.accordion.register(this);
}
AubsAccordionGroupCustomElement.prototype.bind = function bind() {
if (typeof this.isOpen !== 'boolean') {
this.isOpen = false;
}
this.showClass = this.isBootstrapVersion(4) ? 'show' : 'in';
};
AubsAccordionGroupCustomElement.prototype.attached = function attached() {
if (this.isOpen) {
this.$collapse.classList.add('in');
(0, _velocityAnimate2.default)(this.$collapse, 'slideDown', { duration: 0 });
}
};
AubsAccordionGroupCustomElement.prototype.isBootstrapVersion = function isBootstrapVersion(version) {
return _bootstrapOptions.bootstrapOptions.version === version;
};
AubsAccordionGroupCustomElement.prototype.isOpenChanged = function isOpenChanged() {
this.animate();
if (this.isOpen) {
this.accordion.groupToggled(this);
}
};
AubsAccordionGroupCustomElement.prototype.toggle = function toggle() {
this.isOpen = !this.isOpen;
};
AubsAccordionGroupCustomElement.prototype.animate = function animate() {
if (this.isOpen) {
this.$collapse.classList.add(this.showClass);
(0, _velocityAnimate2.default)(this.$collapse, 'slideDown');
} else {
(0, _velocityAnimate2.default)(this.$collapse, 'slideUp');
this.$collapse.classList.remove(this.showClass);
}
};
return AubsAccordionGroupCustomElement;
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "title", [_aureliaFramework.bindable], {
enumerable: true,
initializer: null
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "panelClass", [_aureliaFramework.bindable], {
enumerable: true,
initializer: function initializer() {
return _bootstrapOptions.bootstrapOptions.accordionGroupPanelClass;
}
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "isOpen", [_dec2], {
enumerable: true,
initializer: function initializer() {
return false;
}
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "disabled", [_aureliaFramework.bindable], {
enumerable: true,
initializer: function initializer() {
return false;
}
})), _class2)) || _class) || _class);
});
Loading