<div dir="ltr">I'm using a js file with a handful of jQuery functions wrapped in Drupal.behaviors to move, retag or alter some items on the Commerce product detail page and collection page.<div><br></div><div>The issue I have is that the final function does not fire. If I take it, replace the $'s in it with jQuery and paste it in the console of firebug or chrome tools, it works just fine (it rewraps the page title).</div>
<div><br></div><div>The js contents are below. The page is: <a href="http://testing.ayendesigns.com/xooples/skincare">http://testing.ayendesigns.com/xooples/skincare</a></div><div><br></div><div><br></div><div><br></div><div>
<div>(function ($) {</div><div> Drupal.behaviors.moveWishlist = {</div><div> attach: function(context, settings) {</div><div> $('<div class="wish-list"></div>').once('moveWish', function() {</div>
<div> $(this).appendTo('form.commerce-add-to-cart > div');</div><div> $('.node-product-display li.flag-wish_list').appendTo('ul.links');</div><div> })</div><div> }</div><div>
};</div><div> Drupal.behaviors.moveAddThis = {</div><div> attach: function(context, settings) {</div><div> $('<li class="addthis"></li>').once('addthis1').appendTo('.node-product-display ul.links');</div>
<div> $(".node-product-display a[href^='<a href="http://www.addthis">http://www.addthis</a>']").once('addthis2').appendTo('li.addthis');</div><div> }</div><div> };</div><div> Drupal.behaviors.moveLinks = {</div>
<div> attach: function(context, settings) {</div><div> $('.node-product-display .group-right ul.links').once('addthislinks').appendTo('.node-product-display div#tabs');</div><div> }</div>
<div> };</div><div> Drupal.behaviors.moveTrending = {</div><div> attach: function(context, settings) {</div><div> $('li.flag-trending').once('moveTrending').appendTo('.node-product-display ul.links');</div>
<div> }</div><div> };</div><div> Drupal.behaviors.titleTag = {</div><div> attach: function(context, settings) {</div><div> $('body.page-node header').find('h2').once('titleTag').replaceWith(function() {</div>
<div> return '<h1 class="field-name-title-field">' + $(this).text() + '</h1>';</div><div> });</div><div> }</div><div> };</div><div> Drupal.behaviors.categoryPage = {</div>
<div> attach: function(context, settings) {</div><div> $('.page-product-category .view-display-id-page').once('categoryPage', function() {$(this).find('div.taxonomy-title').replaceWith(function() {</div>
<div> return '<h1 class="taxonomy-title"><span>' + $(this).text() + '</span></h1>';</div><div> });</div><div> })}</div><div> };</div><div> })(jQuery);</div>
<div><br></div><div><br></div>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div>
<div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div>
</div></div>