aboutsummaryrefslogtreecommitdiffstats
path: root/static/ui.js
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-04-27 15:52:00 -0700
committerAdam Mathes <adam@trenchant.org>2018-04-27 15:52:00 -0700
commit5068ca5c0d88694ec1c25dce81c747d5cfa6b54e (patch)
tree644bfb34b8525dbb7077ea5b2a3f5a1e24512b82 /static/ui.js
parentb773d3b1fa1ca4e01b100eb5e89b88b8347740ce (diff)
downloadneko-5068ca5c0d88694ec1c25dce81c747d5cfa6b54e.tar.gz
neko-5068ca5c0d88694ec1c25dce81c747d5cfa6b54e.tar.bz2
neko-5068ca5c0d88694ec1c25dce81c747d5cfa6b54e.zip
separator for scrape
Diffstat (limited to 'static/ui.js')
-rw-r--r--static/ui.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/static/ui.js b/static/ui.js
index 0c60630..4e6d7e0 100644
--- a/static/ui.js
+++ b/static/ui.js
@@ -208,7 +208,7 @@ var ControlsView = Backbone.View.extend({
var Item = Backbone.Model.extend({
idAttribute: "_id",
- url: '/item/',
+ url: '/item',
initialize: function() {
var p_url = this.get('url');
@@ -252,6 +252,16 @@ var Item = Backbone.Model.extend({
full: function() {
this.set({'full': !(this.get('full'))} );
+ // this should just use this.fetch() but
+ // it kept GETing from /item instead of /item/id
+ // so just hacking this in for now
+
+ if(this.get('full_content') == "") {
+ $.getJSON('/item/' + this.get('_id'), function(data) {
+ var i = App.items.get(data['_id'])
+ i.set('full_content', data['full_content']);
+ });
+ }
}
});
@@ -259,6 +269,8 @@ var Item = Backbone.Model.extend({
var ItemCollection = Backbone.Collection.extend({
model: Item,
+ url: '/item',
+
initialize: function() {
_.bindAll(this, 'boot', 'reboot');
},