2014-12-06 17:34:00 +00:00
|
|
|
export default {
|
|
|
|
minimum() {
|
|
|
|
return this._spec.minimum();
|
|
|
|
},
|
|
|
|
|
|
|
|
maximum() {
|
|
|
|
return this._spec.maximum();
|
|
|
|
},
|
|
|
|
|
|
|
|
greedy() {
|
|
|
|
return (this._greedy.textValue !== '');
|
|
|
|
},
|
|
|
|
|
2014-12-09 23:08:40 +00:00
|
|
|
hasSkip() {
|
2014-12-06 17:34:00 +00:00
|
|
|
return this.minimum() === 0;
|
|
|
|
},
|
|
|
|
|
2014-12-09 23:08:40 +00:00
|
|
|
hasLoop() {
|
2014-12-06 17:34:00 +00:00
|
|
|
return this.maximum() === -1 || this.maximum() > 1;
|
|
|
|
},
|
|
|
|
|
2014-12-09 23:08:40 +00:00
|
|
|
contentPosition() {
|
2014-12-06 17:34:00 +00:00
|
|
|
var x = 0, y = 0;
|
|
|
|
|
2014-12-10 22:14:14 +00:00
|
|
|
if (this.hasLoop()) {
|
|
|
|
x = 10;
|
2014-12-06 17:34:00 +00:00
|
|
|
}
|
|
|
|
|
2014-12-10 22:14:14 +00:00
|
|
|
if (this.hasSkip()) {
|
|
|
|
y = 10;
|
2014-12-06 17:34:00 +00:00
|
|
|
x = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Snap.matrix().translate(x, y);
|
|
|
|
}
|
|
|
|
}
|