Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   checkDelivery : function() {
  2.     if (this.checkTimeout) { clearTimeout(this.checkTimeout); }
  3.  
  4.     this.checkTimeout = setTimeout(
  5.       dojo.partial(
  6.         dojo.hitch(this, '_realCheckDelivery'),
  7.         this.user.getAddress(),
  8.         this.tray.deliveryTime
  9.       ),  
  10.       this.checkDeliveryWait
  11.     );  
  12.   },  
  13.  
  14.   _realCheckDelivery : function(addr, deliveryTime) {
  15.     dojo.when(
  16.       this.model.checkDelivery(addr, deliveryTime),
  17.       dojo.hitch(this, '_checkMinimums')
  18.     );  
  19.   },  
  20.  
  21.   _checkMinimums : function(resp) {
  22.     this.mino = resp.mino;
  23.     this.delivery = resp.del;
  24.        
  25.     if (!resp || !resp.delivery) {
  26.       dojo.publish('/menu/disable', [ resp.msg ]);
  27.       dojo.publish('/app/error', [ resp.msg ]);
  28.     } else {
  29.       dojo.publish('/menu/enable');
  30.     }  
  31.        
  32.     dojo.publish('/menu/meals', [ resp.meals ]);
  33.     dojo.publish('/restaurant/details', [ resp ]);                                                                                          
  34.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement