New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May you help me? How to remove this HightLight Section ? #9

Closed
gclove opened this Issue Aug 21, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@gclove

gclove commented Aug 21, 2015

Use this ? It just could be hide .

 document.getElements('pre').enlight(false);

And remove #div.EnlighterJSWrapper# ?

It can't hightlight again ... :-(

@gclove

This comment has been minimized.

gclove commented Aug 21, 2015

I wanna remove it , Because When I execute it many times. It will show highlight section many times.

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Aug 21, 2015

Dear XMap,

For performance reasons the enlight(false) call will only toggle the container visibility (EnlighterJSWrapper is set to invisible, you pre container visible again).

In case you remove the DOM it cannot be highlighted again - you have to create a new EnlighterJS instance.

Best regards, Andi

Am 21.08.2015 um 07:28 schrieb XMap notifications@github.com:

I wanna remove it , Because When I execute it many times. It will show highlight section many times.


Reply to this email directly or view it on GitHub.

@gclove

This comment has been minimized.

gclove commented Aug 26, 2015

En, I'm know that ... but why this framework use this MooTools .Does it conflict with jQuery or Angulr?

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Aug 26, 2015

You can use MooTools together with jQuery. But you should take of the the script include priority: http://mootools.net/blog/2009/06/22/the-dollar-safe-mode

@AndiDittrich AndiDittrich added Enhancement and removed wontfix labels Nov 1, 2015

@AndiDittrich AndiDittrich added this to the v2.10.0 milestone Nov 1, 2015

@AndiDittrich AndiDittrich self-assigned this Nov 1, 2015

@AndiDittrich

This comment has been minimized.

Member

AndiDittrich commented Nov 1, 2015

i've added an additional dispose() function to the EnlighterJS class which will destroy all generated DOM Elements and restores the original state (unhighligted code).

Element Style

// remove highlighting (drop generated HTML from DOM)
document.id('myHighlightedCode').enlight('dispose');

OOP Style

// create a new EnlighterJS instance
var myEnlighter = new EnlighterJS(document.id('myCustomCode'), {
  language: 'php',
  showLinenumbers: false
});

// enable highlighting
myEnlighter.enlight(true);

// remove highlighting (drop generated HTML from DOM)
myEnlighter.dispose();
@gclove

This comment has been minimized.

gclove commented Nov 4, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment