You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
464 B
JavaScript
24 lines
464 B
JavaScript
10 years ago
|
define(['underscore', 'backbone'], function SlideModelDefine(_, Backbone) {
|
||
|
'use strict';
|
||
|
var Model = Backbone.Model;
|
||
|
|
||
|
function SlideModel() {
|
||
|
Model.apply(this, arguments);
|
||
|
}
|
||
|
|
||
|
SlideModel.prototype = new Model();
|
||
|
|
||
|
_.extend(SlideModel.prototype, {
|
||
|
url: function url() {
|
||
|
var id = this.get('id');
|
||
|
if (id < 10) {
|
||
|
return '/slide/0' + id;
|
||
|
} else {
|
||
|
return '/slide/' + id;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return SlideModel;
|
||
|
});
|