dist/hashedit.js
function() {

      var attrs, x, y, z, key, value, html, inputs, textarea;

      console.log(hashedit.current.node);

      if (hashedit.current.node !== null) {

        // get attributes
        attrs = hashedit.current.node.attributes;

        for (x = 0; x < attrs.length; x += 1) {

          // get key and value
          key = attrs[x].nodeName.replace(/-([a-z])/g, function(g) {
            return g[1].toUpperCase();
          });
          value = attrs[x].nodeValue;

          // if is numeric
          if (!isNaN(parseFloat(value)) && isFinite(value)) {
            value = parseFloat(value);
          }

          // set value
          inputs = document.querySelectorAll('[data-model="node.' + key + '"]');

          for (y = 0; y < inputs.length; y += 1) {
            inputs[y].value = value;
          }

        }

        // get html
        html = hashedit.current.node.innerHTML;

        // remove the element menu
        var i = html.indexOf('<span class="hashedit-element-menu"');
        html = html.substring(0, i);

        inputs = document.querySelectorAll('[data-model="node.html"]');

        for (y = 0; y < inputs.length; y += 1) {
          inputs[y].value = html;
        }


      }


    }
function() {

      var attrs, x, y, z, key, value, html, inputs, textarea;

      console.log(hashedit.current.node);

      if (hashedit.current.node !== null) {

        // get attributes
        attrs = hashedit.current.node.attributes;

        for (x = 0; x < attrs.length; x += 1) {

          // get key and value
          key = attrs[x].nodeName.replace(/-([a-z])/g, function(g) {
            return g[1].toUpperCase();
          });
          value = attrs[x].nodeValue;

          // if is numeric
          if (!isNaN(parseFloat(value)) && isFinite(value)) {
            value = parseFloat(value);
          }

          // set value
          inputs = document.querySelectorAll('[data-model="node.' + key + '"]');

          for (y = 0; y < inputs.length; y += 1) {
            inputs[y].value = value;
          }

        }

        // get html
        html = hashedit.current.node.innerHTML;

        // remove the element menu
        var i = html.indexOf('<span class="hashedit-element-menu"');
        html = html.substring(0, i);

        inputs = document.querySelectorAll('[data-model="node.html"]');

        for (y = 0; y < inputs.length; y += 1) {
          inputs[y].value = html;
        }


      }


    }
function ( ) { var attrs , x , y , z , key , value , html , inputs , textarea ; console . log ( hashedit . current . node ) ; if ( hashedit . current . node !== null ) { // get attributes attrs = hashedit . current . node . attributes ; for ( x = 0 ; x < attrs . length ; x += 1 ) { // get key and value key = attrs [ x ] . nodeName . replace ( / -([a-z]) / g , function ( g ) { return g [ 1 ] . toUpperCase ( ) ; } ) ; value = attrs [ x ] . nodeValue ; // if is numeric if ( ! isNaN ( parseFloat ( value ) ) && isFinite ( value ) ) { value = parseFloat ( value ) ; } // set value inputs = document . querySelectorAll ( '[data-model="node.' + key + '"]' ) ; for ( y = 0 ; y < inputs . length ; y += 1 ) { inputs [ y ] . value = value ; } } // get html html = hashedit . current . node . innerHTML ; // remove the element menu var i = html . indexOf ( '<span class="hashedit-element-menu"' ) ; html = html . substring ( 0 , i ) ; inputs = document . querySelectorAll ( '[data-model="node.html"]' ) ; for ( y = 0 ; y < inputs . length ; y += 1 ) { inputs [ y ] . value = html ; } } }
Binds data from the current element
Binds data from the current element