1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 06:39:43 +02:00

Introduce modular UI framework

1. Modals wrapped
2. Toolbar icon actions: click and link-to navigation
3. Moved components into sub-folders
4. Replaced Bootstrap Tooltip and Dropdown libs with Ember specific add-ons

And more.

Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
Co-Authored-By: McMatts <matt@documize.com>
This commit is contained in:
Harvey Kandola 2018-12-11 18:00:08 +00:00
parent f140e7ef77
commit 6eb68f84e0
48 changed files with 330 additions and 240 deletions

View file

@ -9,46 +9,41 @@
//
// https://documize.com
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import Component from '@ember/component';
export default Component.extend({
router: service(),
tagName: 'i',
classNames: ['dicon'],
classNameBindings: ['calcClass'],
color: '',
icon: '',
tooltip: '',
calcClass: computed(function() {
let c = '';
let icon = this.icon;
switch (this.color) {
case 'red':
c += 'red';
break;
case 'yellow':
c += 'yellow';
break;
case 'green':
c += 'green';
break;
}
c += ' ';
if (icon === 'delete') c += 'dicon-bin';
if (icon === 'print') c += 'dicon-print';
if (icon === 'settings') c += 'dicon-settings-gear';
if (icon === 'plus') c += 'dicon-e-add';
if (icon === 'person') c += 'dicon-single-01';
c += ' ';
if (this.color !== '') c += this.color + ' ';
if (icon !== '') c += icon + ' ';
return c.trim();
}),
click() {
this.onClick();
click(e) {
if (is.not.undefined(this.onClick)) {
this.onClick(e);
return;
}
if (is.not.undefined(this.linkTo)) {
// TODO:
// Pass in linkModel, linkOptions
// https://emberjs.com/api/ember/3.5/classes/RouterService/methods/transitionTo?anchor=transitionTo
this.router.transitionTo(this.linkTo);
}
}
});