ep_headings/static/js/index.js
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");
    }
  })
}
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");
    }
  })
}
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" ) ; } } ) }
Bind the event handler to the toolbar buttons
Bind the event handler to the toolbar buttons