Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23615

Windows: Problem adding eventlistener twice to Ti.UI.ImageView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.4.0
    • Fix Version/s: Release 5.4.0
    • Component/s: Windows
    • Labels:
      None
    • Environment:

      SDK 6.0.0.v20160616195531

    • Story Points:
      5
    • Sprint:
      2016 Sprint 14 SDK

      Description

      1. Add eventListener to ImageView
      2. Click ImageView
      3. Remove eventListener
      4. Add same eventListener again.
      5. Click ImageView
      6. Notice that the last click event will not be fired

      index.xml

      <Alloy>
      	<Window class="container" id="win">
      		<Label id="label" onClick="doClick">Hello, World</Label>
      	</Window>
      </Alloy>
      

      index.js

      var imgview = Ti.UI.createImageView({height:100, width:100, image:'images/nav_backicon.png', top:10});
      $.win.add(imgview);
       
      imgview.addEventListener('click', clickListener);
      Ti.API.info("added listener 1");
       
      function clickListener(e) {
      	alert("clicked");
      	imgview.removeEventListener('click', clickListener);
      	
      	setTimeout(function () {
      		imgview.addEventListener('click', clickListener);
      		Ti.API.info("added listener 2");
      	}, 2000);
      }
      $.win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              jonasbjurhult Jonas Bjurhult
              Reviewer:
              Kota Iguchi (Inactive)
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9901
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration