Skip to content

Commit

Permalink
Merge pull request #47 from magento-vanilla/PR
Browse files Browse the repository at this point in the history
[Vanilla] Bug Fixes. P1. JS static fails
  • Loading branch information
guz-anton committed Oct 26, 2015
2 parents d59a6fd + 3253282 commit 108f621
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

<?php $_divId = 'tree-div_' . time() ?>
<div id="<?php /* @escapeNotVerified */ echo $_divId ?>" class="tree"></div>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<script>
require([
'jquery',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
<div><?php /* @escapeNotVerified */ echo __('This operation can take a long time'); ?></div>
</div>
</div>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<script>
var tree;
require([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

<?php $_divId = 'tree' . $block->getId() ?>
<div id="<?php /* @escapeNotVerified */ echo $_divId ?>" class="tree"></div>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<![]-->
<script>
require(['jquery', "prototype", "extjs/ext-tree-checkbox"], function(jQuery){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
<span class="title"><?php /* @escapeNotVerified */ echo __('Unassigned Attributes') ?></span>
</div>
<div id="tree-div2" class="attribute-set-tree"></div>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<script>
define("tree-panel",
[
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Checkout/view/frontend/web/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ define([
actions: {
confirm: function () {
self._removeItem($(event.currentTarget));
},
always: function (event) {
event.stopImmediatePropagation();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
<item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">cms_page_listing.cms_page_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Text */
?>
<fieldset class="fieldset ignore-validate">
<fieldset class="fieldset">
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Manage Swatch (values of your attribute)') ?></span></legend>
<div id="swatch-text-options-panel">
<?php //@todo move style to css file ?>
Expand All @@ -33,16 +33,23 @@
<th class="col-delete">&nbsp;</th>
</tr>
</thead>
<tbody data-role="swatch-text-options-container"></tbody>
<tbody data-role="swatch-text-options-container" class="ignore-validate"></tbody>
<tfoot>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="col-actions-add">
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
<button id="add_new_swatch_text_option_button" title="<?php /* @escapeNotVerified */ echo __('Add Swatch'); ?>"
type="button" class="action- scalable add">
<span><?php /* @escapeNotVerified */ echo __('Add Swatch'); ?></span>
</button>
<?php endif; ?>
</th>
<tr>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>">
<input type="hidden" class="required-swatch-entry"/>
</th>
</tr>
<tr>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="col-actions-add">
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
<button id="add_new_swatch_text_option_button" title="<?php /* @escapeNotVerified */ echo __('Add Swatch'); ?>"
type="button" class="action- scalable add">
<span><?php /* @escapeNotVerified */ echo __('Add Swatch'); ?></span>
</button>
<?php endif; ?>
</th>
</tr>
</tfoot>
</table>
<input type="hidden" id="swatch-text-option-count-check" value="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
?>
<fieldset class="fieldset ignore-validate">
<fieldset class="fieldset">
<legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Manage Swatch (values of your attribute)') ?></span></legend>
<div id="swatch-visual-options-panel">
<?php //@todo move style to css file ?>
Expand All @@ -29,16 +29,23 @@
<th class="col-delete">&nbsp;</th>
</tr>
</thead>
<tbody data-role="swatch-visual-options-container"></tbody>
<tbody data-role="swatch-visual-options-container" class="ignore-validate"></tbody>
<tfoot>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="col-actions-add">
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
<button id="add_new_swatch_visual_option_button" title="<?php /* @escapeNotVerified */ echo __('Add Swatch'); ?>"
type="button" class="action- scalable add">
<span><?php /* @escapeNotVerified */ echo __('Add Swatch'); ?></span>
</button>
<?php endif; ?>
</th>
<tr>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>">
<input type="hidden" class="required-swatch-entry"/>
</th>
</tr>
<tr>
<th colspan="<?php /* @escapeNotVerified */ echo $storetotal; ?>" class="col-actions-add">
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()):?>
<button id="add_new_swatch_visual_option_button" title="<?php /* @escapeNotVerified */ echo __('Add Swatch'); ?>"
type="button" class="action- scalable add">
<span><?php /* @escapeNotVerified */ echo __('Add Swatch'); ?></span>
</button>
<?php endif; ?>
</th>
</tr>
</tfoot>
</table>
<input type="hidden" id="swatch-visual-option-count-check" value="" />
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Ui/Component/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public function update(UiComponentInterface $component)
{
if ($component instanceof ColumnInterface) {
$filterType = $component->getData('config/filter');

if (is_array($filterType)) {
$filterType = $filterType['filterType'];
}

if (!$filterType) {
return;
}
Expand Down
13 changes: 0 additions & 13 deletions app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ define([
}
},

/**
* Extends instance with defaults, extends config with formatted values
* and options, and invokes initialize method of AbstractElement class.
*
* @returns {Object} Chainable
*/
initialize: function () {
this._super()
.initOptions();

return this;
},

/**
* Parses options and merges the result with instance
*
Expand Down
32 changes: 16 additions & 16 deletions app/code/Magento/Ui/view/base/web/js/lib/registry/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

define([
'underscore',
'mageUtils',
Expand All @@ -13,11 +14,11 @@ define([
* @constructor
*/
function Events(storage) {
this.id = 0,
this.id = 0;

this.requests = new Map();
this.map = {};
this.storage = storage;
this.requests = new Map();
this.map = {};
this.storage = storage;

_.bindAll(this, '_resolve', '_clear');
}
Expand All @@ -28,7 +29,7 @@ define([
/**
* Tries to resolve dependencies affected by the scpecified element.
* @param {String} elem - Elements' name.
* @returns {events} Chainable.
* @returns {Object} Chainable.
*/
resolve: function (elem) {
var pending = this.map[elem];
Expand All @@ -44,17 +45,16 @@ define([

/**
* Creates a new request for the specified set
of elements in case some of them wasn't registered yeat.
Otherwise triggers callback immediately.
* of elements in case some of them wasn't registered yeat.
* Otherwise triggers callback immediately.
* @param {Array} elems - Requested elements.
* @param {Function} callback -
Callback that will be triggered as soon as
all of the elements will be registered.
* @param {Object} callback - that will be triggered as soon as
* all of the elements will be registered.
* @returns {events} Chainable.
*/
wait: function (elems, callback) {
var storage = this.storage,
map = this.map;
map = this.map;

if (storage.has(elems)) {
return callback.apply(null, storage.get(elems));
Expand All @@ -79,9 +79,9 @@ define([
* @returns {Boolean} Whether specified request was successfully resolved.
*/
_resolve: function (id) {
var request = this.requests.get(id),
elems = request.deps,
storage = this.storage,
var request = this.requests.get(id),
elems = request.deps,
storage = this.storage,
isResolved;

isResolved = storage.has(elems);
Expand All @@ -99,8 +99,8 @@ define([
* @param {Number} id - Id of request.
*/
_clear: function (id) {
var map = this.map,
elems = this.requests.get(id).deps;
var map = this.map,
elems = this.requests.get(id).deps;

elems.forEach(function (elem) {
utils.remove(map[elem], id);
Expand Down
16 changes: 8 additions & 8 deletions app/code/Magento/Ui/view/base/web/js/modal/confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ define([
/**
* Click handler.
*/
click: function () {
this.closeModal();
click: function (event) {
this.closeModal(event);
}
}, {
text: $.mage.__('OK'),
Expand All @@ -50,8 +50,8 @@ define([
/**
* Click handler.
*/
click: function () {
this.closeModal(true);
click: function (event) {
this.closeModal(event, true);
}
}]
},
Expand Down Expand Up @@ -82,15 +82,15 @@ define([
/**
* Close modal window.
*/
closeModal: function (result) {
closeModal: function (event, result) {
result = result || false;

if (result) {
this.options.actions.confirm();
this.options.actions.confirm(event);
} else {
this.options.actions.cancel();
this.options.actions.cancel(event);
}
this.options.actions.always();
this.options.actions.always(event);
this.element.bind('confirmclosed', _.bind(this._remove, this));

return this._super();
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Ui/view/base/web/js/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ define([
/**
* Default action on button click
*/
click: function () {
this.closeModal();
click: function (event) {
this.closeModal(event);
}
}]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

<?php $_divId = 'tree' . $block->getId() ?>
<div id="<?php /* @escapeNotVerified */ echo $_divId ?>" class="tree"></div>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<script>
require(['jquery', "prototype", "extjs/ext-tree-checkbox"], function(jQuery){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
<div class="actions"><?php echo $block->getAddLayoutButtonHtml() ?></div>
</div>
</fieldset>
<!--[if IE]>
<script id="ie-deferred-loader" defer="defer" src=""></script>
<![endif]-->
<script>
require([
'jquery',
Expand Down
2 changes: 1 addition & 1 deletion dev/tools/grunt/assets/legacy-build/shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(function () {
'use strict';

var globals = ['Prototype', 'Abstract', 'Try', 'Class', 'PeriodicalExecuter', 'Template', '$break', 'Enumerable', '$A', '$w', '$H', 'Hash', '$R', 'ObjectRange', 'Ajax', '$', 'Form', 'Field', '$F', 'Toggle', 'Insertion', '$continue', 'Position', 'Windows', 'Dialog', 'array', 'WindowUtilities', 'Builder', 'Effect', 'validateCreditCard', 'Validator', 'Validation', 'removeDelimiters', 'parseNumber', 'popWin', 'setLocation', 'setPLocation', 'setLanguageCode', 'decorateGeneric', 'decorateTable', 'decorateList', 'decorateDataList', 'parseSidUrl', 'formatCurrency', 'expandDetails', 'isIE', 'Varien', 'fireEvent', 'modulo', 'byteConvert', 'SessionError', 'varienLoader', 'varienLoaderHandler', 'setLoaderPosition', 'toggleSelectsUnderBlock', 'varienUpdater', 'confirmSetLocation', 'deleteConfirm', 'setElementDisable', 'toggleParentVis', 'toggleFieldsetVis', 'toggleVis', 'imagePreview', 'checkByProductPriceType', 'toggleSeveralValueElements', 'toggleValueElements', 'submitAndReloadArea', 'syncOnchangeValue', 'updateElementAtCursor', 'firebugEnabled', 'disableElement', 'enableElement', 'disableElements', 'enableElements', 'Cookie', 'Fieldset', 'Base64', 'sortNumeric', 'Element', '$$', 'Sizzle', 'Selector', 'Window'];
var globals = ['Prototype', 'Abstract', 'Try', 'Class', 'PeriodicalExecuter', 'Template', '$break', 'Enumerable', '$A', '$w', '$H', 'Hash', '$R', 'ObjectRange', 'Ajax', '$', 'Form', 'Field', '$F', 'Toggle', 'Insertion', '$continue', 'Position', 'Windows', 'Dialog', 'array', 'WindowUtilities', 'Builder', 'Effect', 'validateCreditCard', 'Validator', 'Validation', 'removeDelimiters', 'parseNumber', 'popWin', 'setLocation', 'setPLocation', 'setLanguageCode', 'decorateGeneric', 'decorateTable', 'decorateList', 'decorateDataList', 'parseSidUrl', 'formatCurrency', 'expandDetails', 'isIE', 'Varien', 'fireEvent', 'modulo', 'byteConvert', 'SessionError', 'varienLoader', 'varienLoaderHandler', 'setLoaderPosition', 'toggleSelectsUnderBlock', 'varienUpdater', 'setElementDisable', 'toggleParentVis', 'toggleFieldsetVis', 'toggleVis', 'imagePreview', 'checkByProductPriceType', 'toggleSeveralValueElements', 'toggleValueElements', 'submitAndReloadArea', 'syncOnchangeValue', 'updateElementAtCursor', 'firebugEnabled', 'disableElement', 'enableElement', 'disableElements', 'enableElements', 'Cookie', 'Fieldset', 'Base64', 'sortNumeric', 'Element', '$$', 'Sizzle', 'Selector', 'Window'];

globals.forEach(function (prop) {
/* jshint evil:true */
Expand Down
7 changes: 1 addition & 6 deletions lib/web/fotorama/fotorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -2229,14 +2229,9 @@ fotoramaVersion = '4.6.4';
stageLeft = 0,

fadeStack = [];
if (Modernizr.touch) {
$wrap[STAGE_FRAME_KEY] = $('<a class="' + stageFrameClass + '" target="_blank"></a>');
} else {
$wrap[STAGE_FRAME_KEY] = $('<div class="' + stageFrameClass + '"></div>');
}

$wrap[STAGE_FRAME_KEY] = $('<div class="' + stageFrameClass + '"></div>');
$wrap[NAV_THUMB_FRAME_KEY] = $($.Fotorama.jst.thumb());

$wrap[NAV_DOT_FRAME_KEY] = $($.Fotorama.jst.dots());

toDeactivate[STAGE_FRAME_KEY] = [];
Expand Down
4 changes: 2 additions & 2 deletions lib/web/fotorama/fotorama.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/web/legacy-build.min.js

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions lib/web/mage/adminhtml/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ function setLocation(url){
window.location.href = url;
}

function confirmSetLocation(message, url){
if( confirm(message) ) {
setLocation(url);
}
return false;
}

function deleteConfirm(message, url) {
confirmSetLocation(message, url);
}

function setElementDisable(element, disable){
if($(element)){
$(element).disabled = disable;
Expand Down
Loading

0 comments on commit 108f621

Please sign in to comment.