code: function(hook, context){
    var hs = $('#heading-selection');
    hs.on('change', function(){
      var value = $(this).val();
      var intValue = parseInt(value,10);
      if(!_.isNaN(intValue)){
        context.ace.callWithAce(function(ace){
          ace.ace_doInsertHeading(intValue);
        },'insertheading' , true);
        hs.val("dummy");
      }
    })
  }
docs: Bind the event handler to the toolbar buttons