Skip to content
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

Statusbar init lines and words values #299

Closed
FabianKoestring opened this issue Apr 15, 2016 · 2 comments
Closed

Statusbar init lines and words values #299

FabianKoestring opened this issue Apr 15, 2016 · 2 comments
Labels
Milestone

Comments

@FabianKoestring
Copy link
Contributor

FabianKoestring commented Apr 15, 2016

Hey there!

I have following problem. Everytime i set a text in an textarea the statusbar values like lines and words doesnt update on there own. I have to go into the textarea and type any char to refresh the values.

<textarea name="myContent" class="input-markdown">
# Suos ipse

## Crepitantibus viri colorem

Lorem markdownum circumspicit vertice remollescunt opera arent! Tenuem Delphica
qui [similis](http://www.uselessaccount.com/) tenet neque, *spiramenta turea*:
erat praestantior deterritus sinistra pedum.

## India oranti fontem attulit plumas

Solebat primus vulnera aquarum, **vulnere quinquennia corque** ferum. Multa
mater vulnera orbis aliquem tenuit **dux dederint**, non cum et proque omnia
sedesque iuvenum? E lingua, est si eadem squalere [auditurum vocant
his](http://www.billmays.net/) cognoscere servat facit et cum tenet una et vero.
</textarea>
var $elem = $('.input-markdown');
    $elem.each(function () {
        var current = $(this);
        var simplemde = new SimpleMDE(
        {
            element: current[0],
            spellChecker: false
        }
    );
});

Is there a way to refresh the values on my own? Or maybe this is a bug or even i do something wrong with the initialisation of the element?

https://jsfiddle.net/ggnfjjvf/1/

Thanks!

@FabianKoestring
Copy link
Contributor Author

What about changing the default values?

if(name === "words") {
    defaultValue = function(el) {
        el.innerHTML = wordCount(cm.getValue());
        //el.innerHTML = "0";
    };
    onUpdate = function(el) {
        el.innerHTML = wordCount(cm.getValue());
    };
} else if(name === "lines") {
    defaultValue = function(el) {
        el.innerHTML = cm.lineCount();
        //el.innerHTML = "0";
    };
    onUpdate = function(el) {
        el.innerHTML = cm.lineCount();
    };
}
...

@FabianKoestring FabianKoestring changed the title Statusbar refresh lines and words values Statusbar init lines and words values Apr 17, 2016
@WesCossick WesCossick added the bug label Apr 22, 2016
@WesCossick WesCossick added this to the 1.11.0 milestone Apr 22, 2016
WesCossick pushed a commit that referenced this issue Jun 8, 2016
@WesCossick
Copy link
Member

This will be released in the next version of SimpleMDE.

@WesCossick WesCossick mentioned this issue Jun 8, 2016
jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Jul 29, 2019
The status bar *does* work now, but I don't think we should turn it on
unless there's a reason to. See
sparksuite/simplemde-markdown-editor#334 and
sparksuite/simplemde-markdown-editor#299.
jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Jul 29, 2019
The status bar *does* work now, but I don't think we should turn it on
unless there's a reason to. See
sparksuite/simplemde-markdown-editor#334 and
sparksuite/simplemde-markdown-editor#299.
jfly added a commit to jfly/worldcubeassociation.org that referenced this issue Jul 31, 2019
The status bar *does* work now, but I don't think we should turn it on
unless there's a reason to. See
sparksuite/simplemde-markdown-editor#334 and
sparksuite/simplemde-markdown-editor#299.
jfly added a commit to thewca/worldcubeassociation.org that referenced this issue Jul 31, 2019
The status bar *does* work now, but I don't think we should turn it on
unless there's a reason to. See
sparksuite/simplemde-markdown-editor#334 and
sparksuite/simplemde-markdown-editor#299.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants