From 976e548ef7721615c447cab89a660533aade997f Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 11 Mar 2015 22:39:29 +0000 Subject: [PATCH] TinyMCE wpViews: use the real attribute value instead of the cached jQuery data. Fixes updating of the wpView text strings. Props iseulde. Fixes #31601. git-svn-id: https://develop.svn.wordpress.org/trunk@31731 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/mce-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/js/mce-view.js b/src/wp-includes/js/mce-view.js index dad9ddc8c7..d8eef009b5 100644 --- a/src/wp-includes/js/mce-view.js +++ b/src/wp-includes/js/mce-view.js @@ -181,7 +181,7 @@ window.wp = window.wp || {}; return instances[ encodeURIComponent( object ) ]; } - return instances[ $( object ).data( 'wpview-text' ) ]; + return instances[ $( object ).attr( 'data-wpview-text' ) ]; }, /** @@ -192,7 +192,7 @@ window.wp = window.wp || {}; * @return {String} The textual representation of the view. */ getText: function( node ) { - return decodeURIComponent( $( node ).data( 'wpview-text' ) || '' ); + return decodeURIComponent( $( node ).attr( 'data-wpview-text' ) || '' ); }, /**