Plugin Directory

Changeset 1968406


Ignore:
Timestamp:
11/04/2018 12:28:25 AM (7 years ago)
Author:
martindrapeau
Message:

Fixed bug with initializing amilia store block attribute.

Location:
amilia-store/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • amilia-store/trunk/amilia-store.php

    r1968084 r1968406  
    66Author: Martin Drapeau <martin.drapeau@amilia.com>
    77Copyright: 2014-2018 Amilia
    8 Version: 2.8.1
     8Version: 2.8.2
    99Author URI: http://www.amilia.com/
    1010License: Apache License 2.0
  • amilia-store/trunk/blocks/amilia-store-iframe.js

    r1968082 r1968406  
    11(function(wp) {
    2     var registerBlockType = wp.blocks.registerBlockType;
     2  var registerBlockType = wp.blocks.registerBlockType;
    33  var InspectorControls = wp.editor.InspectorControls;
    44  var PanelBody = wp.components.PanelBody;
     
    88  var SelectControl = wp.components.SelectControl;
    99  var Dashicon = wp.components.Dashicon;
    10     var el = wp.element.createElement;
     10  var el = wp.element.createElement;
    1111  var withState = wp.compose.withState;
    12     var __ = wp.i18n.__;
     12  var __ = wp.i18n.__;
    1313
    1414  function AmiliaControl(props) {
     
    1818    var status = props.status;
    1919    var url = attributes.url === null ? window.Amilia.storeUrl : attributes.url;
     20    if (url != attributes.url) setAttributes({url: url});
    2021
    2122    function onValidateUrl(result) {
     
    6869  }
    6970
    70     registerBlockType('amilia-store/amilia-store-iframe', {
    71         title: __('Amilia Store'),
    72         category: 'embed',
    73         icon: {
     71  registerBlockType('amilia-store/amilia-store-iframe', {
     72    title: __('Amilia Store'),
     73    category: 'embed',
     74    icon: {
    7475      foreground: '#46aaf8',
    75             src: 'store'
    76         },
     76      src: 'store'
     77    },
    7778    attributes: {
    7879      url: {
     
    8586      }
    8687    },
    87         edit: withState({status: ''})(AmiliaControl),
    88         save: function(props) {
     88    edit: withState({status: ''})(AmiliaControl),
     89    save: function(props) {
    8990      return null;
    90         }
    91     });
     91    }
     92  });
    9293
    9394})(window.wp);
Note: See TracChangeset for help on using the changeset viewer.