To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #391 (new defect)

Opened 21 months ago

Last modified 13 months ago

area/slot class .editing-now is left on after editing is completed in some situations

Reported by: johnnyoffline Owned by: tboutell
Priority: major Milestone: 1.5.2
Component: apostrophePlugin Version: trunk
Keywords: slots, areas, ui Cc: johnnyoffline, rickybanister, boutell, dordille, jake, geoffd, agilbert
Symfony version: 1.4

Description (last modified by jake) (diff)

The last time I touched this functionality was with [1107].

There is a class of 'editing-now' appended to the Area and corresponding Slot that is used for CSS and UI stuff.

That class is getting stuck on in some situations. Please check it out. I know there was a little weirdness with Variants, but it seems like there's other situations as well.

It's not a major major problem because when you refresh the page it's fine. BUT it's annoying and should be fixed.

Maybe we can work together on it.

Attachments

_slot.php.diff Download (1.3 KB) - added by jake 20 months ago.
_slot.php diff

Change History

Changed 21 months ago by boutell

  • milestone changed from 1.4 to 1.4.1

Changed 20 months ago by jake

  • description modified (diff)

Tom, I ran into this issue when i scoped some css to .editing-now. It only occurs when clicking the SAVE button. When you click the CANCEL button, all .editing-now classes are removed, when you click the SAVE button, the .editing-now class on .a-slot remains.

The javascript that removes the .editing-now class from the various places in the area/slot when you click SAVE doesn't count for .a-slot.editing-now.

I'm sure it would be pretty simple to fix the javascript so it removes that class as well. I tested something out and it worked, which you can see in the attached diff, but i'll leave it to you to figure out how best to fix this.

Changed 20 months ago by jake

_slot.php diff

Changed 20 months ago by jake

I talked to John about this and he went through slot.php and cut out a little more redundant/old stuff, this is the same bit of javascript with a little more love.

		$('#a-slot-form-cancel-<?php echo $id ?>').click(function(){
  		$(view).children('.a-slot-content').children('.a-slot-content-container').fadeIn();
  		$(view).children('.a-controls-item variant').fadeIn();
  		$(view).children('.a-slot-content').children('.a-slot-form').hide();
  		$(view).find('.editing-now').removeClass('editing-now');
 			$(view).parents('.a-area.editing-now').removeClass('editing-now').find('.editing-now').removeClass('editing-now'); // for singletons
  	});

		// SAVE 
  	$('#a-slot-form-submit-<?php echo $id ?>').click(function(){
  		$(view).find('.editing-now').removeClass('editing-now');
 			$(view).parents('.a-area.editing-now').removeClass('editing-now').find('.editing-now').removeClass('editing-now'); // for singletons
 			window.apostrophe.callOnSubmit('<?php echo $id ?>');
 			return true;
  	});

ps: not sure why my .diff can't be viewed on trac, but you can see it if you download the original. it's not really relevant anymore... but whatever.

Changed 17 months ago by tboutell

  • owner changed from boutell to tboutell

Changed 13 months ago by geoffd

  • milestone changed from 1.4.2 to 1.5.1
Note: See TracTickets for help on using tickets.