/**
 * Created by nuintun on 2015/3/31.
 */

'use strict';

var $ = require('jquery');

function Choice(){

}

// 公开接口
module.exports = Choice;
@@ -85,29 +85,1228 @@
 );%0A%0A
-function Choice()%7B%0A%0A%7D
+var doc = $(document);%0Avar reference = %7B%7D;%0A%0Afunction Choice(type, scope)%7B%0A  this.type = type;%0A%0A  if (!scope.nodeType %7C%7C (scope.nodeType !== 1 && scope.nodeType !== 9 && scope.nodeType !== 11)) %7B%0A    scope = document;%0A  %7D%0A%0A  this.elements = $('input%5Btype=' + type + '%5D', scope);%0A%7D%0A%0AChoice.prototype = %7B%0A  init: function ()%7B%0A    if (!reference%5Bthis.type%5D) %7B%0A      doc.on('change.beauty-' + this.type, 'input%5Btype=' + type + '%5D', function ()%7B%0A%0A      %7D);%0A%0A      reference%5Bthis.type%5D = this.elements.length;%0A    %7D else %7B%0A      reference%5Bthis.type%5D += this.elements.length;%0A    %7D%0A  %7D,%0A  beauty: function ()%7B%0A    var context = this;%0A%0A    this.elements.each(function ()%7B%0A      var element = $(this);%0A%0A      element.wrap('%3Ci class=%22ui-beauty-choice ui-beauty-' + context.type + '%22/%3E');%0A      element.data('data-beauty-choice', true);%0A    %7D);%0A  %7D,%0A  destory: function ()%7B%0A    var context = this;%0A%0A    this.elements.each(function ()%7B%0A      var element = $(this);%0A%0A      if (element.data('data-beauty-choice')) %7B%0A        element.unwrap();%0A        element.removeData('data-beauty-choice');%0A%0A        reference%5Bcontext.type%5D--;%0A      %7D%0A    %7D);%0A%0A    if (!reference%5Bthis.type%5D) %7B%0A      doc.off('change.beauty-' + this.type);%0A    %7D%0A  %7D%0A%7D;
 %0A%0A//
@@ -1335,8 +1335,9 @@
  Choice;
+%0A

update files