-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from documize/ember-data-store
Push data from services into ember data store
- Loading branch information
Showing
43 changed files
with
1,092 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved. | ||
// | ||
// This software (Documize Community Edition) is licensed under | ||
// This software (Documize Community Edition) is licensed under | ||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html | ||
// | ||
// You can operate outside the AGPL restrictions by purchasing | ||
// Documize Enterprise Edition and obtaining a commercial license | ||
// by contacting <sales@documize.com>. | ||
// by contacting <sales@documize.com>. | ||
// | ||
// https://documize.com | ||
|
||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
document: {}, | ||
meta: [], | ||
pages: [], | ||
document: {}, | ||
meta: [], | ||
pages: [], | ||
|
||
didReceiveAttrs() { | ||
let editors = this.get('meta.editors'); | ||
let toc = this.get('pages'); | ||
didReceiveAttrs() { | ||
let editors = this.get('meta.editors'); | ||
let toc = this.get('pages'); | ||
|
||
if (is.null(editors)) { | ||
return; | ||
} | ||
if (is.null(editors)) { | ||
return; | ||
} | ||
|
||
editors.forEach(function(item) { | ||
Ember.set(item, "added", item.action === "add-page"); | ||
Ember.set(item, "changed", item.action === "update-page"); | ||
Ember.set(item, "deleted", item.action === "remove-page"); | ||
editors.forEach(function (item) { | ||
Ember.set(item, "added", item.action === "add-page"); | ||
Ember.set(item, "changed", item.action === "update-page"); | ||
Ember.set(item, "deleted", item.action === "remove-page"); | ||
|
||
let page = _.findWhere(toc, { | ||
id: item.pageId | ||
}); | ||
let title = ""; | ||
let page = _.findWhere(toc, { | ||
id: item.pageId | ||
}); | ||
let title = ""; | ||
|
||
if (is.not.undefined(page)) { | ||
title = page.title; | ||
if (is.not.undefined(page)) { | ||
title = page.get('title'); | ||
|
||
if (item.added) { | ||
Ember.set(item, 'changeLabel', "added " + title); | ||
} | ||
if (item.added) { | ||
Ember.set(item, 'changeLabel', "added " + title); | ||
} | ||
|
||
if (item.changed) { | ||
Ember.set(item, 'changeLabel', "changed " + title); | ||
} | ||
} else { | ||
Ember.set(item, "deleted", true); | ||
if (item.changed) { | ||
Ember.set(item, 'changeLabel', "changed " + title); | ||
} | ||
} else { | ||
Ember.set(item, "deleted", true); | ||
|
||
if (item.added) { | ||
Ember.set(item, 'changeLabel', "added section (since removed)"); | ||
} | ||
if (item.added) { | ||
Ember.set(item, 'changeLabel', "added section (since removed)"); | ||
} | ||
|
||
if (item.changed) { | ||
Ember.set(item, 'changeLabel', "changed section (since removed)"); | ||
} | ||
if (item.changed) { | ||
Ember.set(item, 'changeLabel', "changed section (since removed)"); | ||
} | ||
|
||
if (item.deleted) { | ||
Ember.set(item, 'changeLabel', "removed section"); | ||
} | ||
} | ||
}); | ||
} | ||
}); | ||
if (item.deleted) { | ||
Ember.set(item, 'changeLabel', "removed section"); | ||
} | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.