Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7696985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:54:25+00:00 2026-05-31T21:54:25+00:00

This is in the context of a Dojo editor, but it should apply more

  • 0

This is in the context of a Dojo editor, but it should apply more generally.

I have an <img> tagged that is wrapped in a <a> tag:

<a><img width="146" height="109" src="/gaggleVideoProxy.do?op=thumb&amp;thumbUrl=http://i.ytimg.com/vi/xoZXdWl7BZs/default.jpg" _djrealurl="/gaggleVideoProxy.do?op=thumb&amp;thumbUrl=http://i.ytimg.com/vi/xoZXdWl7BZs/default.jpg" &ytvideoid="xoZXdWl7BZs&amp;userVideoId=1073344&quot;"></a>

If you click on this, the image is selected. Clicking the delete key will cause the image to be deleted, but leaves the link tag.

I’m looking for a way to ensure that the <a> tag is deleted whenever the <img> tag is deleted.


Update

This turns out to be more of a dojo api question. Looking at this SO question/answer has given me the basic tools to do what I need:

How can i add event listener to the content of dojo editor?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:54:27+00:00Added an answer on May 31, 2026 at 9:54 pm

    This works:

    _connectTagEvents: function(){
        this.editor.onLoadDeferred.addCallback(dojo.hitch(this, function(){
      this.connect(this.editor.editNode, "onclick", this._onClick);
        }));
    },
    _onClick: function(e){
      var target = e.target;
      var tag = target.tagName ? target.tagName.toLowerCase() : "";
      var wrapper = target.parentNode;
    
      if(/* TAG and/or WRAPPER are what you want*/) {        
        dojo.withGlobal(this.editor.window, "selectElement", dijit._editor.selection, [wrapper]);
      }
    }
    

    And this will force the wrapping element to be selected. (Don’t forget to call _connectTagEvents from the initButton() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with dojo editor. And I have a problem so could you
I found this in the dojo.js library: 13444: color >>= bits; Context: ArrayUtil.forEach([b, g,
I have this terrible problem with IE 7/8/9. I wrote an app using Dojo
I have a problem with dijit editor of dojo: I used execCommand to insert
So I have this simple require: require(['app/'+url,'dojo/text!content/'+url], function(module,template){ if(module.init){ module.init({ container: panel, containerId: 'contentTabs_'
my web application is based on dojo 1.6.0. The problem that I have is
I've come across a very strange issue that I have a workaround for, but
i am using following code using dojo to have tooltipdialog ,, by using this
Basically, it goes like this. I have a very structured dojo application using the
I have been using Dojo and Dijit for more than a year to develop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.