Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 0.3.1
Browse files Browse the repository at this point in the history
Conflicts:
	src/gridmanager.js
  • Loading branch information
neokoenig committed Jul 27, 2014
2 parents 082bbdb + 245a142 commit 3ac5312
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/gridmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1222,11 +1222,27 @@
* @method cleanup
* @returns null
*/

gm.cleanup = function(){
// cache canvas
var canvas=gm.$el.find("#" + gm.options.canvasId);

var canvas,
content;

// cache canvas
canvas = gm.$el.find("#" + gm.options.canvasId);

/**
* Determine the current edit mode and get the content based upon the resultant
* context to prevent content in source mode from being lost on save, as such:
*
* edit mode (source): canvas.find('textarea').val()
* edit mode (visual): canvas.html()
*/
content = gm.mode !== "visual" ? canvas.find('textarea').val() : canvas.html();

// Clean any temp class strings
canvas.html(gm.cleanSubstring(gm.options.classRenameSuffix, canvas.html(), ''));
canvas.html(gm.cleanSubstring(gm.options.classRenameSuffix, content, ''));

// Clean column markup
canvas.find(gm.options.colSelector)
.removeAttr("style")
Expand Down

0 comments on commit 3ac5312

Please sign in to comment.