Skip to content

Commit

Permalink
bugfixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonpecora committed Apr 25, 2018
1 parent 3a3e184 commit 1804ce6
Show file tree
Hide file tree
Showing 5 changed files with 306 additions and 301 deletions.
2 changes: 2 additions & 0 deletions edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { standardCurve } from './lib/utils/references';
import 'keen-ui/src/bootstrap'; // import this once, for KeenUI components
import 'velocity-animate/velocity.ui.min.js'; // import this once, for velocity ui stuff
import VueObserveVisibility from 'vue-observe-visibility';
import VueClickOutside from 'vue-click-outside';

// set animation defaults
velocity.defaults.easing = standardCurve;
Expand Down Expand Up @@ -63,6 +64,7 @@ Vue.config.keyCodes.comma = 188;

// register directives
Vue.directive('conditional-focus', conditionalFocus());
Vue.directive('click-outside', VueClickOutside);

// export api for plugins, validators, inputs, buttons, etc
window.kiln = window.kiln || {};
Expand Down
2 changes: 1 addition & 1 deletion inputs/complex-list-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
return _.has(this.schema, 'collapse');
},
collapsedTitle() {
return _.get(this.data, _.get(this.schema, 'collapse'), 'New Item');
return _.get(this.data, _.get(this.schema, 'collapse')) || 'New Item';
},
props() {
return _.get(this, 'schema.props');
Expand Down
6 changes: 5 additions & 1 deletion inputs/complex-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<template>
<transition mode="out-in" name="hide-show" @after-enter="onResize">
<div class="complex-list" v-if="items.length">
<div class="complex-list" v-if="items.length" v-click-outside="unselect">
<transition-group mode="out-in" name="hide-show" tag="div" class="complex-list-items" @after-enter="onListResize">
<item v-for="(item, index) in items"
:index="index"
Expand Down Expand Up @@ -124,6 +124,7 @@
let items = _.cloneDeep(this.items);
items.splice(index + 1, 0, newObj); // add new item after the specified index
this.currentItem = index + 1; // select new item
this.updateFormData(items); // save the data
},
removeItem(index) {
Expand All @@ -147,6 +148,9 @@
}
this.updateFormData(items); // save the data
},
unselect() {
this.currentItem = null;
},
onCurrentChange(index) {
this.currentItem = index;
}
Expand Down

0 comments on commit 1804ce6

Please sign in to comment.