- init_mine: function (lease, unclick) {
- var o = lease.scheduler.options;
- lease.current="mine";
- lease.animate((lease.initial=="mine") ? attr_lease_mine_mine : attr_lease_free_mine,o.anim_delay);
- lease.click (lease_methods.click_mine);
- if (unclick) lease.unclick(unclick);
- },
-
- /* TODO: remove selected lease from array listLeases and publish change */
- click_mine: function (event) {
- var scheduler = this.scheduler;
- // this lease was originally free but is now marked for booking
- // we free just this lease
- //console.log('this is mine');
- lease_methods.init_free(this, lease_methods.click_mine);
- },
-
-
- init_other: function (lease, slicename) {
- lease.animate (attr_lease_other,anim_delay);
- /* a text obj to display the name of the slice that owns that lease */
- var otherslicelabel = lease.scheduler.paper.text (lease.attr("x")+lease.attr("width")/2,
- // xxx
- lease.attr("y")+lease.attr("height")/2,slicename).attr(txt_otherslice);
- /* hide it right away */
- otherslicelabel.hide();
- /* record it */
- lease.label=otherslicelabel;
- lease.hover ( function (e) {this.label.toFront();this.label.show();},
- function (e) {this.label.hide();} );
- }
+ /* We need to inform manifold about the whole diff, in addition to maintaining our own structure */
+ jQuery.publish('/update-set/' + scheduler.options.lease_query_uuid, [scheduler._leases]);
+ },
+
+ _lease_init_mine: function (lease, unclick)
+ {
+ var o = lease.scheduler.options;
+ lease.current = "mine";
+ lease.animate((lease.initial == "mine") ? attr_lease_mine_mine : attr_lease_free_mine, o.anim_delay);
+ lease.click(this._lease_click_mine);
+ if (unclick)
+ lease.unclick(unclick);
+ },
+
+ /* TODO: remove selected lease from array _leases and publish change */
+ _lease_click_mine: function (event)
+ {
+ var scheduler = this.scheduler;
+ // this lease was originally free but is now marked for booking
+ // we free just this lease
+ //console.log('this is mine');
+ scheduler._lease_init_free(this, scheduler._lease_click_mine);
+ },
+
+
+ lease_init_other: function (lease, slicename)
+ {
+ lease.animate (attr_lease_other,anim_delay);
+ /* a text obj to display the name of the slice that owns that lease */
+ var otherslicelabel = lease.scheduler.paper.text (lease.attr("x")+lease.attr("width")/2,
+ // xxx
+ lease.attr("y")+lease.attr("height")/2,slicename).attr(txt_otherslice);
+ /* hide it right away */
+ otherslicelabel.hide();
+ /* record it */
+ lease.label=otherslicelabel;
+ lease.hover ( function (e) {this.label.toFront();this.label.show();},
+ function (e) {this.label.hide();} );