Rock.Web.UI.Controls.NoteControl.OnInit C# (CSharp) Method

OnInit() protected method

Raises the E:System.Web.UI.Control.Init event.
protected OnInit ( EventArgs e ) : void
e System.EventArgs An object that contains the event data.
return void
        protected override void OnInit( EventArgs e )
        {
            base.OnInit( e );

            string script = @"
            $('a.edit-note').click(function (e) {
            e.preventDefault();
            $(this).closest('.note').children().slideToggle( 'slow' );
            });
            $('a.edit-note-cancel').click(function () {
            $(this).closest('.note').children().slideToggle( 'slow' );
            });
            $('a.remove-note').click(function() {
            return Rock.dialogs.confirmDelete( event, 'Note' );
            });
            ";
            ScriptManager.RegisterStartupScript( this, this.GetType(), "edit-note", script, true );
        }