Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkDelivery : function() {
- if (this.checkTimeout) { clearTimeout(this.checkTimeout); }
- this.checkTimeout = setTimeout(
- dojo.partial(
- dojo.hitch(this, '_realCheckDelivery'),
- this.user.getAddress(),
- this.tray.deliveryTime
- ),
- this.checkDeliveryWait
- );
- },
- _realCheckDelivery : function(addr, deliveryTime) {
- dojo.when(
- this.model.checkDelivery(addr, deliveryTime),
- dojo.hitch(this, '_checkMinimums')
- );
- },
- _checkMinimums : function(resp) {
- this.mino = resp.mino;
- this.delivery = resp.del;
- if (!resp || !resp.delivery) {
- dojo.publish('/menu/disable', [ resp.msg ]);
- dojo.publish('/app/error', [ resp.msg ]);
- } else {
- dojo.publish('/menu/enable');
- }
- dojo.publish('/menu/meals', [ resp.meals ]);
- dojo.publish('/restaurant/details', [ resp ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement