From baf4fbb3f33ebb7767682bc6d46ede879109df9f Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Wed, 23 Nov 2016 11:22:33 +0800 Subject: [PATCH] simplify code --- cocos2d/core/components/CCRichText.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/components/CCRichText.js b/cocos2d/core/components/CCRichText.js index 563fe29e2b..51d0cc8005 100644 --- a/cocos2d/core/components/CCRichText.js +++ b/cocos2d/core/components/CCRichText.js @@ -248,7 +248,8 @@ var RichText = cc.Class({ }, _onTTFLoaded: function () { - if(!this._getFontRawUrl()) return; + var rawUrl = this._getFontRawUrl(); + if(!rawUrl) return; var self = this; @@ -257,7 +258,7 @@ var RichText = cc.Class({ self._updateRichText(); }; - cc.CustomFontLoader.loadTTF(this._getFontRawUrl(), callback); + cc.CustomFontLoader.loadTTF(rawUrl, callback); }, _measureText: function (styleIndex, string) {