mirror of
https://github.com/documize/community.git
synced 2025-07-20 05:39:42 +02:00
record pin event, remove uppercase CSS, reduce AJAX calls
This commit is contained in:
parent
532a8076f5
commit
b2769efbd4
4 changed files with 19 additions and 2 deletions
|
@ -118,6 +118,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
unpin() {
|
unpin() {
|
||||||
|
this.audit.record('unpinned-document');
|
||||||
|
|
||||||
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
||||||
this.set('pinState.isPinned', false);
|
this.set('pinState.isPinned', false);
|
||||||
this.set('pinState.pinId', '');
|
this.set('pinState.pinId', '');
|
||||||
|
@ -137,6 +139,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.audit.record('pinned-document');
|
||||||
|
|
||||||
this.get('pinned').pinItem(pin).then((pin) => {
|
this.get('pinned').pinItem(pin).then((pin) => {
|
||||||
this.set('pinState.isPinned', true);
|
this.set('pinState.isPinned', true);
|
||||||
this.set('pinState.pinId', pin.get('id'));
|
this.set('pinState.pinId', pin.get('id'));
|
||||||
|
|
|
@ -100,6 +100,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
unpin() {
|
unpin() {
|
||||||
|
this.audit.record('unpinned-space');
|
||||||
|
|
||||||
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
||||||
this.set('pinState.isPinned', false);
|
this.set('pinState.isPinned', false);
|
||||||
this.set('pinState.pinId', '');
|
this.set('pinState.pinId', '');
|
||||||
|
@ -119,6 +121,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.audit.record('pinned-space');
|
||||||
|
|
||||||
this.get('pinned').pinItem(pin).then((pin) => {
|
this.get('pinned').pinItem(pin).then((pin) => {
|
||||||
this.set('pinState.isPinned', true);
|
this.set('pinState.isPinned', true);
|
||||||
this.set('pinState.pinId', pin.get('id'));
|
this.set('pinState.pinId', pin.get('id'));
|
||||||
|
|
|
@ -72,6 +72,8 @@ export default Ember.Component.extend(TooltipMixin, {
|
||||||
var sortable = Sortable.create(document.getElementById('pinned-zone'), {
|
var sortable = Sortable.create(document.getElementById('pinned-zone'), {
|
||||||
animation: 150,
|
animation: 150,
|
||||||
onEnd: function () {
|
onEnd: function () {
|
||||||
|
self.audit.record('reorganized-pins');
|
||||||
|
|
||||||
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
|
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
|
||||||
self.set('pins', pins);
|
self.set('pins', pins);
|
||||||
});
|
});
|
||||||
|
@ -94,7 +96,15 @@ export default Ember.Component.extend(TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
setupPins() {
|
setupPins() {
|
||||||
|
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.get('pinned').getUserPins().then((pins) => {
|
this.get('pinned').getUserPins().then((pins) => {
|
||||||
|
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.set('pins', pins);
|
this.set('pins', pins);
|
||||||
|
|
||||||
pins.forEach((pin) => {
|
pins.forEach((pin) => {
|
||||||
|
|
|
@ -115,7 +115,6 @@
|
||||||
width: 40px;
|
width: 40px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-transform: uppercase;
|
|
||||||
@include ease-in();
|
@include ease-in();
|
||||||
@include border-radius(3px);
|
@include border-radius(3px);
|
||||||
font-family: $font-semibold;
|
font-family: $font-semibold;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue