Skip to content

Continues to Count when Element is gone #8

@Nvenom

Description

@Nvenom

I use this to count a users time spent with a dialog open, and i was feeling a bit lazy to bind a destroy function to all the dialog close functions, so naturally i added a little quick fix. im no expert so im not sure if this is okay or if it will continue to run "render"

Changed

render: function() {
            var $this = $(this),
                data = $this.data('stopwatch');
            $this.html(data.formatter(data.elapsed, data));
        }

To This

render: function() {
            var $this = $(this),
                data = $this.data('stopwatch');
            if(data){
                $this.html(data.formatter(data.elapsed, data));
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions