Coder Social home page Coder Social logo

Timer problem Reset about timer.jquery HOT 6 CLOSED

walmik avatar walmik commented on May 31, 2024
Timer problem Reset

from timer.jquery.

Comments (6)

walmik avatar walmik commented on May 31, 2024

Thank you for using the plugin and filing this issue. This contributes to the overall improvement of this plugin :) Can you please provide the exact steps to reproduce the issue? Also can you keep your console open while performing the steps and share the console contents in case you see some error in there as well?

from timer.jquery.

AlexAraujoBr avatar AlexAraujoBr commented on May 31, 2024

Example:

   $(function (e) {
      $('#DT').timer({
         format: '%H:%M:%S'  
      });          
      $(document).on('click','#bnt', function(){
          $('#DT').timer('reset');
      });
   });


    <p>
        <div id="DT"> </div>
    </p>
    <button type="button" id="bnt" >&nbsp;Reset Timer</button>

from timer.jquery.

AlexAraujoBr avatar AlexAraujoBr commented on May 31, 2024

I got doing a "workaround". I´m just modify "resetTimer" function.

function resetTimer(timer) {
var element = timer.element;
stopTimerInterval(timer);
timer.options.removeTimer.bind(timer).call();
$(element).data('plugin_' + pluginName, 0);
$(element).data('seconds', 0);
$(element).data('state', 0);
startTimerInterval(timer);
//stopTimerInterval(timer);
//$(element).data('seconds', 0);
//$(element).data('totalSeconds', 0);
//$(element).data('startTime', 0);
//$(element).data('state', TIMER_STOPPED);
$(element).data('duration', timer.options.duration);
timer.options.resetTimer.bind(timer).call();
}

from timer.jquery.

walmik avatar walmik commented on May 31, 2024

Thanks for fixing it, this looks good! Can you please submit a PR for this?

from timer.jquery.

walmik avatar walmik commented on May 31, 2024

Hi @AlexAraujoBr

I think something seems funky. I was updating the Develop branch locally to match the recent merges in Master and it shows as if your PR got merged! Can you please check if your changes are in there? Also another thing is, I dont see a fork of this repo in your Github. Can you please tell me how you created the PR?

from timer.jquery.

walmik avatar walmik commented on May 31, 2024

Fixed in #63
Thanks to @AlexAraujoBr

from timer.jquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.