1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 21:59:42 +02:00

record pin event, remove uppercase CSS, reduce AJAX calls

This commit is contained in:
Harvey Kandola 2016-11-22 10:05:32 -08:00
parent 532a8076f5
commit b2769efbd4
4 changed files with 19 additions and 2 deletions

View file

@ -118,6 +118,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
},
unpin() {
this.audit.record('unpinned-document');
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
this.set('pinState.isPinned', false);
this.set('pinState.pinId', '');
@ -137,6 +139,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
return false;
}
this.audit.record('pinned-document');
this.get('pinned').pinItem(pin).then((pin) => {
this.set('pinState.isPinned', true);
this.set('pinState.pinId', pin.get('id'));

View file

@ -100,6 +100,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
},
unpin() {
this.audit.record('unpinned-space');
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
this.set('pinState.isPinned', false);
this.set('pinState.pinId', '');
@ -119,6 +121,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
return false;
}
this.audit.record('pinned-space');
this.get('pinned').pinItem(pin).then((pin) => {
this.set('pinState.isPinned', true);
this.set('pinState.pinId', pin.get('id'));
@ -126,6 +130,6 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
});
return true;
}
}
}
});

View file

@ -72,6 +72,8 @@ export default Ember.Component.extend(TooltipMixin, {
var sortable = Sortable.create(document.getElementById('pinned-zone'), {
animation: 150,
onEnd: function () {
self.audit.record('reorganized-pins');
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
self.set('pins', pins);
});
@ -94,7 +96,15 @@ export default Ember.Component.extend(TooltipMixin, {
},
setupPins() {
if (this.get('isDestroyed') || this.get('isDestroying')) {
return;
}
this.get('pinned').getUserPins().then((pins) => {
if (this.get('isDestroyed') || this.get('isDestroying')) {
return;
}
this.set('pins', pins);
pins.forEach((pin) => {

View file

@ -115,7 +115,6 @@
width: 40px;
text-align: center;
overflow: hidden;
text-transform: uppercase;
@include ease-in();
@include border-radius(3px);
font-family: $font-semibold;