Guest User

Untitled

a guest
Dec 13th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. var MyBalloonContentLayout = ymaps.templateLayoutFactory.createClass(
  2. '<h3>$[properties.balloonContentHeader]</h3>' +
  3. '<div>$[properties.balloonContentBody]</div>' +
  4. '<div> <a href="#" id="more">Подробнее</a></div>', {
  5. build: function() {
  6. MyBalloonContentLayout.superclass.build.call(this);
  7. $('#more').bind('click', this.onMoreClick);
  8. },
  9. clear: function() {
  10. $('#more').unbind('click', this.onMoreClick);
  11. MyBalloonContentLayout.superclass.clear.call(this);
  12. },
  13. onMoreClick: function() {
  14. alert('УРА');
  15. }
  16. }
  17. );
  18.  
  19. // Добавляю опцию для балуна
  20. objectManager.objects.options.set('balloonContentLayout', 'MyBalloonContentLayout');
Add Comment
Please, Sign In to add comment