success: function(data){ var appStorage = require('storage/appStorage') data = JSON.parse(data); if (!data.err_msg) { appStorage.topics.get(data.topic_id).set('starred', data.starred); appStorage.topics.get(data.topic_id).get('starred'); } else { console.log(data.err_msg); } }
success: function(data){ data = JSON.parse(data); var appStorage = require('storage/appStorage'); var Topic = require('model/Topic'); appStorage.topics.reset(); _.each(data, function(topic){ var currentTopic = new Topic(topic); appStorage.topics.add(currentTopic); }); }
success: function(data){ var appStorage = require('storage/appStorage'); var Topic = require('model/Topic'); var TopicListTableRowView = require('view/TopicListTableRow'); data = JSON.parse(data); if(!data.err_msg) { $("#reply-control").remove(); var newTopic = new Topic(data); newTopic.set('newCreated', true); if(newTopic.get('category_id') === appStorage.currentCategory.get('id')) { appStorage.topics.add(newTopic); var topicListTableRowView = new TopicListTableRowView({ model: newTopic }); } } else { console.log(data.err_msg); } }
_.each(data, function(topic){ var currentTopic = new Topic(topic); appStorage.topics.add(currentTopic); var topicListTableRowView = new TopicListTableRowView({ model: currentTopic }); });
_.each(data, function(topic){ var currentTopic = new Topic(topic); appStorage.topics.add(currentTopic); });
_.each(PreloadStore.data.topics, function(topic){ var currentTopic = new Topic(topic); appStorage.topics.add(currentTopic); });